You need to use metric_relabel_configs, not relabel_configs.
* relabel_configs is run for the target relabelling phase, *before* scraping.
It can be used to modify the address and port being scraped.
* metric_relabel_configs is run *after* scraping. It can be used to modify
or drop the metrics returned by the scrape.
Also, I believe the label names are case-sensitive.
On Wednesday, 8 March 2023 at 19:57:08 UTC Kordován Szabolcs wrote:
> Hi All,
>
> I would like to modify a label but it seems that prometheus doesn't find
> the label. I have checked the source of the relabel, I found nothing.
>
> The metric:
> zxAnGponRmAniRxOptLevel{ifDescr="gponxxxxx", ifIndex="285278721",
> instance="xxx.xxx.xxx.xxx:yyyyy", job="query",
> zxAnGponOnuMgmtRegistrationInfo="1,ZTEGXXXXXXXX", zxAnGponRmAniIndex="1",
> zxAnPonOnuIndex="2"}
> 3661
>
> The config:
> relabel_configs:
> - source_labels: [zxangpononumgmtregistrationinfo]
> regex: .*,(.*)
> replacement: "$1"
> target_label: "SN"
>
> Do you have any idea?
>
>
--
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/ea5bcf7b-9feb-48f4-beb8-55a4dff851a3n%40googlegroups.com.