Hi,

Many I ask how to show hostname rather than internal ip in alert message.
With the following settings, $labels.hostname still displays the internal 
ip.

*alert rules definition:*
----------------------------
      - alert: HighCpuLoad
        expr: 100 - (avg by(instance) 
(irate(node_cpu_seconds_total{mode="idle"}[5m])) * 100) > 80
        for: 5m
        labels:
          severity: warning
        annotations:
          summary: "High CPU load (instance {{ $labels.hostname }})"
---------------------------------

*relabel config*
----------------------------------
relabel_configs:
         - source_labels: [__meta_openstack_instance_name]
           target_label: hostname
-------------------------------------

-- 
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/5be15c1b-471e-4f37-b622-703b96cc8fd8n%40googlegroups.com.

Reply via email to