Skip to content

Prefixing Prometheus metrics #4887

Answered by ihcsim
adinhodovic asked this question in General
Aug 17, 2020 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

@adinhodovic For a static prefix, you can update the Prometheus scrape_configs with something like:

metric_relabel_configs:
  - source_labels: [__name__]
    target_label: __name__
    replacement: "prefix_${1}"

For dynamic prefixes, it's better to use labels.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@adinhodovic
Comment options

@ihcsim
Comment options

Answer selected by adinhodovic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #4887 on August 17, 2020 14:49.