-
Notifications
You must be signed in to change notification settings - Fork 548
processor_labels: Add a documentation for processor_labels #1371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
63cb810
processor_labels: Add a documentation for processor_labels
cosmo0920 be15335
processor_labels: Use SHA-256 instead of SHA-1
cosmo0920 3325513
Update labels.md
cosmo0920 f290a65
processor_labels: Clarify an effect of absence of the target key when…
cosmo0920 47b2501
Update pipeline/processors/labels.md
cosmo0920 53d5d37
Update pipeline/processors/labels.md
cosmo0920 0bdb544
Update pipeline/processors/labels.md
cosmo0920 8d08f09
Update pipeline/processors/labels.md
cosmo0920 394c4d7
Update pipeline/processors/labels.md
cosmo0920 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| # Labels | ||
|
|
||
| The **labels** processor lets you manipulate the labels of metrics. | ||
|
|
||
| Similar to filters, this processor presents a enriching/modifying mechanism to | ||
| perform operations for labels manipulation. The most significant difference is | ||
| that processors perform better than filters, and when chaining them there are no | ||
| encoding or decoding performance penalties. | ||
|
|
||
| {% hint style="info" %} | ||
| **Note:** Both processors and this specific component can be enabled only by using | ||
| the YAML configuration format. Classic mode configuration format doesn't support | ||
| processors. | ||
| {% endhint %} | ||
|
|
||
| ## Configuration Parameters | ||
|
|
||
| | Key | Description | | ||
| | :----- | :---------- | | ||
| | update | Update an existing key with a value into metrics. The key/value pair is required. If the specified key doesn't exist, the operation silently fails and has no effect. | | ||
| | insert | Insert a new key with a value into metrics. The key/value pair is required. | | ||
| | upsert | Upsert a specific key with a value, the `upsert` operation will try to update the value of the key. If the key does not exist, the key will be created. The key-value pair is required. | | ||
| | delete | Delete a key from the labels of metrics. The key/value pair is required. If the specified key doesn't exist, the operation silently fails and has no effect. | | ||
| | hash | Replace the key value with a hash generated by the SHA-256 algorithm from the specified label name. The generated binary value is set as a hex string. | | ||
|
|
||
cosmo0920 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| #### Update example | ||
|
|
||
| Change the value of the `name` to `fluentbit`: | ||
|
|
||
| ```yaml | ||
| pipeline: | ||
| inputs: | ||
| - name: fluentbit_metrics | ||
| processors: | ||
| metrics: | ||
| - name: labels | ||
| update: name fluentbit | ||
| outputs: | ||
| - name : stdout | ||
| match: '*' | ||
| ``` | ||
|
|
||
| #### Insert example | ||
|
|
||
| The following example appends the key `agent` with the value `fluentbit` as the label | ||
| of metrics: | ||
|
|
||
| ```yaml | ||
| pipeline: | ||
| inputs: | ||
| - name: fluentbit_metrics | ||
| processors: | ||
| metrics: | ||
| - name: labels | ||
| insert: agent fluentbit | ||
| outputs: | ||
| - name : stdout | ||
| match: '*' | ||
| ``` | ||
|
|
||
| #### Upsert example | ||
|
|
||
| Upsert the value of `name` and insert `fluentbit`: | ||
|
|
||
| ```yaml | ||
| pipeline: | ||
| inputs: | ||
| - name: fluentbit_metrics | ||
| processors: | ||
| metrics: | ||
| - name: labels | ||
| upsert: name fluentbit | ||
| outputs: | ||
| - name : stdout | ||
| match: '*' | ||
| ``` | ||
|
|
||
| #### Delete example | ||
|
|
||
| Delete containing `name` key from metrics: | ||
|
|
||
| ```yaml | ||
| pipeline: | ||
| inputs: | ||
| - name: fluentbit_metrics | ||
| processors: | ||
| metrics: | ||
| - name: labels | ||
| delete: name | ||
| outputs: | ||
| - name : stdout | ||
| match: '*' | ||
| ``` | ||
|
|
||
| #### Hash example | ||
|
|
||
| Apply the SHA-1 algorithm for the value of the key `hostname`: | ||
|
|
||
| ```yaml | ||
| pipeline: | ||
| inputs: | ||
| - name: fluentbit_metrics | ||
| processors: | ||
| metrics: | ||
| - name: labels | ||
| hash: hostname | ||
| outputs: | ||
| - name : stdout | ||
| match: '*' | ||
| ``` | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.