Skip to content

Commit

Permalink
Merge pull request #115 from xocasdashdash/added-docs-for-regex-in-names
Browse files Browse the repository at this point in the history
Added more examples on how to use regex in names
  • Loading branch information
Matthias Rampke authored Jan 20, 2020
2 parents 5c2acb7 + 5ac9488 commit 0c94224
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ mappings:
job: ${1}_server
outcome: $3
provider: $2
- match: 'servers\.(.*)\.networking\.subnetworks\.transmissions\.([a-z0-9-]+)\.(.*)'
match_type: regex
name: 'servers_networking_transmissions_${3}'
labels:
hostname: ${1}
device: ${2}
```

This would transform these example graphite metrics into Prometheus metrics as
Expand All @@ -79,6 +85,11 @@ follows:

test.web-server.foo.bar
=> test_web__server_foo_bar{}

servers.rack-003-server-c4de.networking.subnetworks.transmissions.eth0.failure.mean_rate
=> servers_networking_transmissions_failure_mean_rate{device="eth0",hostname="rack-003-server-c4de"}



### Conversion from legacy configuration

Expand Down

0 comments on commit 0c94224

Please sign in to comment.