The default prometheus config has this set to false, but it is more useful to have it set to true when scraping from pushgateway:
honor_labels controls how Prometheus handles conflicts between labels that are
already present in scraped data and labels that Prometheus would attach
server-side ("job" and "instance" labels, manually configured target
labels, and labels generated by service discovery implementations).
If honor_labels is set to "true", label conflicts are resolved by keeping label
values from the scraped data and ignoring the conflicting server-side labels.
If honorlabels is set to "false", label conflicts are resolved by renaming
conflicting labels in the scraped data to "exported" (for
example "exported_instance", "exported_job") and then attaching server-side
labels.
Setting honor_labels to "true" is useful for use cases such as federation and
scraping the Pushgateway, where all labels specified in the target should be
preserved.
Note that any globally configured "external_labels" are unaffected by this
setting. In communication with external systems, they are always applied only
when a time series does not have a given label yet and are ignored otherwise.
The default prometheus config has this set to
false
, but it is more useful to have it set totrue
when scraping from pushgateway:https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config