Commit 97c0bcec authored by Julius Volz's avatar Julius Volz

Merge pull request #127 from prometheus/hashmod

Document hashmod
parents 06637d55 90ec0c9b
......@@ -308,7 +308,10 @@ source_labels: '[' <labelname> [, ...] ']'
[ target_label: <labelname> ]
# Regular expression against which the extracted value is matched.
regex: <regex>
[ regex: <regex> ]
# Modulus to take of the hash of the source label values.
[ modulus: <uint64> ]
# Replacement value against which a regex replace is performed if the
# regular expression matches.
......@@ -318,7 +321,9 @@ regex: <regex>
[ action: <relabel_action> | default = replace ]
```
`<regex>` is any valid [RE2 regular expression](https://github.com/google/re2/wiki/Syntax).
`<regex>` is any valid [RE2 regular
expression](https://github.com/google/re2/wiki/Syntax). It is required for
the `replace`, `keep`, and `drop` actions.
`<relabel_action>` determines the relabeling action to take:
......@@ -327,6 +332,7 @@ regex: <regex>
(`${1}`, `${2}`, ...) in `replacement` substituted by their value.
* `keep`: Drop targets for which `regex` does not match the concatenated `source_labels`.
* `drop`: Drop targets for which `regex` matches the concatenated `source_labels`.
* `hashmod`: Set `target_label` to the `modulus` of a hash of the concatenated `source_labels`.
### Metric relabeling `<metric_relabel_configs>`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment