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
-------------------------------------