I have an alert instance with the following values:
[ var='B0' metric='Value' labels={device=/dev/mapper/sysvg-dbbackup, fstype=ext4, group=servers, hostname=vmwebext02, human_name=vmwebext02, job=servers, location=ITS, mountpoint=/home/dbbackup, os=linux} value=0.935096177610537 ], ... (more alert instances follow here)
I would like to put the label hostname
in the alert’s summary such as e.g.:
DB backup disk usage >80% on host: {{ labels.hostname }}
However, I am unable to find the correct syntax for this.
Using
DB backup disk usage >80% on host: {{ labels.hostname }}
it prints:
"DB backup disk usage >80% on host: {{ labels.hostname }}"
Using
DB backup disk usage >80% on host: {{ $labels.hostname }}
it prints:
"DB backup disk usage >80% on host: \<no value\>"
What is the correct syntax to achieve this?