Labels
![]()
The labels processor lets you manipulate the labels of metrics.
Similar to filters, this processor presents an 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.
Configuration parameters
update
Updates 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
Inserts a new key with a value into metrics. The key/value pair is required.
upsert
Upserts a specific key with a value, the upsert operation will try to update the value of the key. If the specified key doesn't exist, a new key will be created. The key/value pair is required.
delete
Deletes 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
Replaces 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.
Update example
The following example changes the value of the name key to fluentbit:
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:
Upsert example
The following example upserts the value of name and inserts fluentbit:
Delete example
The following example deletes the name key from metrics:
Hash example
The following example applies the SHA-1 algorithm for the value of the key hostname:
Last updated
Was this helpful?