mirror of
https://github.com/prometheus/statsd_exporter.git
synced 2024-11-14 11:21:17 +00:00
Merge pull request #277 from xocasdashdash/updated-docs
Updated docs and added good/bad example yaml
This commit is contained in:
commit
18a3c26447
2 changed files with 35 additions and 0 deletions
10
README.md
10
README.md
|
@ -198,6 +198,16 @@ mappings:
|
|||
The metric name can also contain references to regex matches. The mapping above
|
||||
could be written as:
|
||||
|
||||
```yaml
|
||||
mappings:
|
||||
- match: "test\\.(\\w+)\\.(\\w+)\\.counter"
|
||||
match_type: regex
|
||||
name: "${2}_total"
|
||||
labels:
|
||||
provider: "$1"
|
||||
```
|
||||
|
||||
Be aware about yaml escape rules as a mapping like the following one will not work.
|
||||
```yaml
|
||||
mappings:
|
||||
- match: "test\.(\w+)\.(\w+)\.counter"
|
||||
|
|
|
@ -842,6 +842,31 @@ mappings:
|
|||
configBad: true,
|
||||
expectedAction: ActionTypeDrop,
|
||||
},
|
||||
{
|
||||
// valid yaml example
|
||||
config: `---
|
||||
mappings:
|
||||
- match: "test\\.(\\w+)\\.(\\w+)\\.counter"
|
||||
match_type: regex
|
||||
name: "${2}_total"
|
||||
labels:
|
||||
provider: "$1"
|
||||
`,
|
||||
configBad: false,
|
||||
expectedAction: ActionTypeMap,
|
||||
},
|
||||
{
|
||||
// invalid yaml example
|
||||
config: `---
|
||||
mappings:
|
||||
- match: "test\.(\w+)\.(\w+)\.counter"
|
||||
match_type: regex
|
||||
name: "${2}_total"
|
||||
labels:
|
||||
provider: "$1"
|
||||
`,
|
||||
configBad: true,
|
||||
},
|
||||
}
|
||||
|
||||
for i, scenario := range scenarios {
|
||||
|
|
Loading…
Reference in a new issue