mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-11 14:53:49 +00:00
31886aef3d
These actions are supported by Prometheus starting from v2.41.0
See https://github.com/prometheus/prometheus/pull/11564 ,
https://github.com/prometheus/prometheus/issues/11556
and https://github.com/prometheus/prometheus/issues/3756
Side note:
It's a pity that Prometheus developers decided inventing `keepequal` and `dropequal`
relabeling actions instead of adding support for `keep_if_equal` and `drop_if_equal` relabeling
actions supported by VictoriaMetrics since June 2020 - see 2a39ba639d
.
55 lines
1.1 KiB
YAML
55 lines
1.1 KiB
YAML
- target_label: bar
|
|
- source_labels: [aa]
|
|
separator: "foobar"
|
|
regex: "foo.+bar"
|
|
target_label: aaa
|
|
replacement: "xxx"
|
|
- action: keep
|
|
source_labels: [aaa]
|
|
- action: drop
|
|
source_labels: [aaa]
|
|
- action: hashmod
|
|
source_labels: [aaa]
|
|
target_label: aaa
|
|
modulus: 234
|
|
- action: replace_all
|
|
source_labels: [aa]
|
|
target_label: bb
|
|
- action: labelmap_all
|
|
regex: "\\."
|
|
replacement: ":"
|
|
- action: keep_if_equal
|
|
source_labels: [foo, bar]
|
|
- action: drop_if_equal
|
|
source_labels: [foo, bar]
|
|
- action: keepequal
|
|
source_labels: [foo]
|
|
target_label: bar
|
|
- action: dropequal
|
|
source_labels: [foo]
|
|
target_label: bar
|
|
- action: keep
|
|
source_labels: [__name__]
|
|
regex:
|
|
- 'fo.*o'
|
|
- 'bar'
|
|
- 'baz.+'
|
|
- action: keep_metrics
|
|
regex: [foo bar baz]
|
|
- action: drop_metrics
|
|
regex: "foo|bar|baz"
|
|
- source_labels: [foo, bar]
|
|
separator: "-"
|
|
target_label: __tmp_uppercase
|
|
action: uppercase
|
|
- source_labels: [__tmp_uppercase]
|
|
target_label: lower_aaa
|
|
action: lowercase
|
|
- if: '{foo=~"bar.*",baz="aa"}'
|
|
target_label: aaa
|
|
replacement: foobar
|
|
- action: graphite
|
|
match: 'foo.*.bar'
|
|
labels:
|
|
instance: 'foo-$1'
|
|
job: '${1}-bar'
|