Hello,
Thank you for your response. However I have already this config part:
- source_labels: ['__meta_consul_node', '__meta_consul_service_port']
target_label: 'instance'
regex: '([^:]*);(.*)'
replacement: '${1}.toto.com:${2}'
action: 'replace'
It is working for new metrics in prometheus. My question is focus on
metrics already saved on disk.
Thanks. Regards.
Le jeu. 9 sept. 2021 à 14:22, Brian Candler <[email protected]> a écrit :
> 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 a topic in the
> Google Groups "Prometheus Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/prometheus-users/4BDu_spHVM0/unsubscribe
> .
> To unsubscribe from this group and all its topics, 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
> <https://groups.google.com/d/msgid/prometheus-users/49c6c965-0b49-43a3-8db6-7372485393cdn%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/CAA3rH8ZWgr7bNM3t7A7vwGEV4beCKoU%3DReFGEz6vO%2BL%2BwZo15A%40mail.gmail.com.