mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-11 14:53:49 +00:00
d6bd956930
These actions simlify metrics filtering. For example, - action: keep_metrics regex: 'foo|bar|baz' would leave only metrics with `foo`, `bar` and `baz` names, while the rest of metrics will be deleted. The commit also makes possible to split long regexps into multiple lines. For example, the following config is equivalent to the config above: - action: keep_metrics regex: - foo - bar - baz
34 lines
679 B
YAML
34 lines
679 B
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: keep
|
|
source_labels: [__name__]
|
|
regex:
|
|
- 'fo.*o'
|
|
- 'bar'
|
|
- 'baz.+'
|
|
- action: keep_metrics
|
|
regex: [foo bar baz]
|
|
- action: drop_metrics
|
|
regex: "foo|bar|baz"
|