This is not possible. Target labels are assigned by Prometheus. This is part of "relabelings" in your ServiceMonitor spec.
Also, you already get this via the `pod` label. https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#monitoring.coreos.com/v1.RelabelConfig On Wed, Jul 26, 2023 at 3:11 PM aadarsh verma <[email protected]> wrote: > I am running the exporter from every pod inside k8s > I want to differentiate the data by pod so I want the exporter to ship > hostname parameter that prints the pod name > > how can i do this without modifying the source code if possible > > -- > 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/3fa05e64-f60f-40ad-8d4a-33cda89693afn%40googlegroups.com > <https://groups.google.com/d/msgid/prometheus-users/3fa05e64-f60f-40ad-8d4a-33cda89693afn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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/CABbyFmoVRJbeEu4Fp0e4-_H9KcVjKRXK_N%2BToTci8Ydp5-uQCg%40mail.gmail.com.

