On Tuesday, 7 June 2022 at 09:55:33 UTC+1 [email protected] wrote:
> That won't work because labelmap needs a `source_labels` to act on.
>
No, I don't believe that's true. I've just tested the following and it
works fine:
relabel_configs:
- action: labelmap
regex: "(__address__)"
replacement: "dummy$1"
Metrics now have an extra "dummy__address__" label.
What I suspect is happening here is that the OP is using relabel_configs
when they should be using metric_relabel_configs.
* relabel_configs is applied *before* the scrape takes place. It can
therefore only affect labels which are returned by the service discovery.
* metric_relabel_configs is applied *after* the scrape takes place. It
processes all the metrics returned by the exporter, and therefore can see
labels which the exporter itself has generated.
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/prometheus-users/3e3ecc01-121a-4760-a170-24ceb2226e5an%40googlegroups.com.