mirror of
https://github.com/prometheus/statsd_exporter.git
synced 2025-01-22 04:18:07 +00:00
Updated docs and added good/bad example yaml
Signed-off-by: Joaquin Fernandez Campo <jfcampo@gmail.com>
This commit is contained in:
parent
7d2a901b6c
commit
84657e85ec
3 changed files with 36 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
## unreleased / ????-??-??
|
||||
|
||||
* [ENHANCEMENT] Updated readme docs and added a test for invalid yaml ([#274](https://github.com/prometheus/statsd_exporter/issues/274))
|
||||
* [ENHANCEMENT] Support sampling factors for all statsd metric types ([#264](https://github.com/prometheus/statsd_exporter/issues/250))
|
||||
* [ENHANCEMENT] Support Librato and InfluxDB labeling formats ([#267](https://github.com/prometheus/statsd_exporter/pull/267))
|
||||
|
||||
|
|
10
README.md
10
README.md
|
@ -200,6 +200,16 @@ 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"
|
||||
match_type: regex
|
||||
name: "${2}_total"
|
||||
|
|
|
@ -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