Skip to content

Commit

Permalink
Prometheus: move the name relabaling to metric_relabel_configs
Browse files Browse the repository at this point in the history
Prometheus does not replace the metrics name when it also needs to
replace the __address__.

To overcome this, we can move the __name__ relabling to the
metric_relabel_configs section, which is perform after the
relabel_config part.
  • Loading branch information
amnonh committed Feb 10, 2019
1 parent e0082df commit f441801
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions prometheus/prometheus.yml.template
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ scrape_configs:
regex: '(.*):\d+'
target_label: instance
replacement: '${1}'
metric_relabel_configs:
- source_labels: [__name__]
regex: 'node_disk_read_bytes_total'
target_label: __name__
Expand Down

0 comments on commit f441801

Please sign in to comment.