Labels
Last updated
Last updated
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.
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.
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 |
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. |
Change the value of the name
to fluentbit
:
The following example appends the key agent
with the value fluentbit
as the label of metrics:
Upsert the value of name
and insert fluentbit
:
Delete containing name
key from metrics:
Apply the SHA-1 algorithm for the value of the key hostname
: