document metric name templating for regex matches

This commit is contained in:
Erick Pintor 2018-01-17 14:30:40 -02:00
parent 27ee4050c4
commit 515ae0ee89

View file

@ -135,6 +135,18 @@ mappings:
provider: "$1" provider: "$1"
``` ```
The metric name can also contain references to regex matches. The mapping above
could be written as:
```
mappings:
- match: test\.(\w+)\.(\w+)\.counter
match_type: regex
name: "${2}_counter"
labels:
provider: "$1"
```
If the default metric help text is insufficient for your needs you may use the YAML If the default metric help text is insufficient for your needs you may use the YAML
configuration to specify a custom help text for each mapping: configuration to specify a custom help text for each mapping:
```yaml ```yaml