I am not going to answer your question because I am using another trick
to achieve this.
In the prometheus config:
alerting:
alert_relabel_configs:
- source_labels: [instance, hostname]
regex: "(.+);"
target_label: hostname
replacement: '$1'
That way, prometheus will add a hostname label equal to the instance to
every alert if it is empty.
Regards,
>
> ?
>
> --
> 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
prometheus-use...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/prometheus-users/dc4da945-8fd1-41dc-9c10-ced090a1ca2d%40googlegroups.com.
--
Julien Pivotto
@roidelapluie