mirror of
https://github.com/prometheus/statsd_exporter.git
synced 2024-12-23 22:10:30 +00:00
Merge pull request #12 from brian-brazil/fix-readme
Correct example, need to specify variables like in bash.
This commit is contained in:
commit
ccbaa9d754
2 changed files with 29 additions and 1 deletions
|
@ -69,7 +69,7 @@ An example mapping configuration:
|
||||||
name="signup_events"
|
name="signup_events"
|
||||||
provider="$2"
|
provider="$2"
|
||||||
outcome="$3"
|
outcome="$3"
|
||||||
job="$1_server"
|
job="${1}_server"
|
||||||
|
|
||||||
This would transform these example StatsD metrics into Prometheus metrics as
|
This would transform these example StatsD metrics into Prometheus metrics as
|
||||||
follows:
|
follows:
|
||||||
|
|
|
@ -60,6 +60,34 @@ func TestMetricMapper(t *testing.T) {
|
||||||
"foo.bar.baz": map[string]string{},
|
"foo.bar.baz": map[string]string{},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
// Config with bad regex reference.
|
||||||
|
{
|
||||||
|
config: `
|
||||||
|
test.*
|
||||||
|
name="name"
|
||||||
|
label="$1_foo"
|
||||||
|
`,
|
||||||
|
mappings: map[string]map[string]string{
|
||||||
|
"test.a": map[string]string{
|
||||||
|
"name": "name",
|
||||||
|
"label": "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
// Config with good regex reference.
|
||||||
|
{
|
||||||
|
config: `
|
||||||
|
test.*
|
||||||
|
name="name"
|
||||||
|
label="${1}_foo"
|
||||||
|
`,
|
||||||
|
mappings: map[string]map[string]string{
|
||||||
|
"test.a": map[string]string{
|
||||||
|
"name": "name",
|
||||||
|
"label": "a_foo",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
// Config with bad metric line.
|
// Config with bad metric line.
|
||||||
{
|
{
|
||||||
config: `
|
config: `
|
||||||
|
|
Loading…
Reference in a new issue