mirror of
https://github.com/prometheus/statsd_exporter.git
synced 2024-12-23 05:56:31 +00:00
Merge pull request #309 from prometheus/mr/issue-256
Allow single-letter components in metric names
This commit is contained in:
commit
ed37775e02
2 changed files with 24 additions and 1 deletions
|
@ -27,7 +27,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
statsdMetricRE = `[a-zA-Z_](-?[a-zA-Z0-9_])+`
|
statsdMetricRE = `[a-zA-Z_](-?[a-zA-Z0-9_])*`
|
||||||
templateReplaceRE = `(\$\{?\d+\}?)`
|
templateReplaceRE = `(\$\{?\d+\}?)`
|
||||||
|
|
||||||
metricLineRE = regexp.MustCompile(`^(\*\.|` + statsdMetricRE + `\.)+(\*|` + statsdMetricRE + `)$`)
|
metricLineRE = regexp.MustCompile(`^(\*\.|` + statsdMetricRE + `\.)+(\*|` + statsdMetricRE + `)$`)
|
||||||
|
|
|
@ -742,6 +742,29 @@ mappings:
|
||||||
`,
|
`,
|
||||||
configBad: true,
|
configBad: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
config: `---
|
||||||
|
mappings:
|
||||||
|
- match: p.*.*.c.*
|
||||||
|
match_type: glob
|
||||||
|
name: issue_256
|
||||||
|
labels:
|
||||||
|
one: $1
|
||||||
|
two: $2
|
||||||
|
three: $3
|
||||||
|
`,
|
||||||
|
mappings: mappings{
|
||||||
|
{
|
||||||
|
statsdMetric: "p.one.two.c.three",
|
||||||
|
name: "issue_256",
|
||||||
|
labels: map[string]string{
|
||||||
|
"one": "one",
|
||||||
|
"two": "two",
|
||||||
|
"three": "three",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
// Example from the README.
|
// Example from the README.
|
||||||
{
|
{
|
||||||
config: `
|
config: `
|
||||||
|
|
Loading…
Reference in a new issue