relabel_configs:
...
- action: replace
regex: .*machine_cpu_cores.*
source_labels:
- env
target_label: node_env
regex: machine_cpu_cores
and a lot of other regex-matches.Hi again,
i also tried out metric_relabel_config.
It only works without the regex line. This is strange somehow, since there are so many other examples.
Am Montag, 12. März 2018 20:23:27 UTC+1 schrieb Brian Brazil:On 12 March 2018 at 19:06, <antonios....@gmx.de> wrote:Hi,
i try to rename the label "env" to "node_env" for the metric "machine_cpu_cores", but the regex does not work.
i added on my prometheus.yml the folowing lines:
relabel_configs:
...
- action: replace
regex: .*machine_cpu_cores.*
source_labels:
- env
target_label: node_env
The replacement only works if the regex-part is commented out, but then it replaces every metric.
I also triedregex: machine_cpu_cores
and a lot of other regex-matches.
What am i doing wrong here?You want to use metric_relabel_configs. See https://www.robustperception.io/relabel_configs-vs-metric_relabel_configs/--Brian Brazil
--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/4e9ad517-89cf-4b88-b543-e0e60653259d%40googlegroups.com.