job is the name of the scrape job, not the name of the host being scraped. Generally, many hosts are scraped with the same scrape job.
What you want to set is the *instance* label: i.e. instance="consul.toto.com" The way to do it is using service discovery relabelling (not metric relabelling). See: https://www.robustperception.io/controlling-the-instance-label https://groups.google.com/forum/#!topic/prometheus-users/I4dVtwI5YrM https://groups.google.com/forum/#!msg/prometheus-users/PPwF-2CQiSc/FsSvfCm3AwAJ As far as I'm aware, you can't change metrics which are already saved to disk, unless you export them all and reimport them (using the recently-added backfilling functionality), and then delete the old timeseries. It would be an interesting feature to be able to change the labels on an existing timeseries, but I haven't seen it mentioned anywhere. On Thursday, 9 September 2021 at 12:51:20 UTC+1 [email protected] wrote: > Hello, > > I just changed my prometheus config to relabel metrics before storing them > on the disk. > > However I would like to rename instance name (from simple name to FQDN) in > the metrics already saved by prometheus on the disk. > > I assume that I need to use promQL with the prometheus editor but I didn't > find on internet the good query to execute. > > *Example:* > > *Rename this:* > node_timex_frequency_adjustment_ratio{address="XX.XX.XX.XX", instance= > "consul:9100", job="consul", service="node-exporter"} > > *Into this:* > node_timex_frequency_adjustment_ratio{address="XX.XX.XX.XX", instance= > "consul:9100", job="consul.toto.com", service="node-exporter"} > > Thanks. > -- 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/49c6c965-0b49-43a3-8db6-7372485393cdn%40googlegroups.com.

