I am using the following query for two Elasticsearch clusters (ES1, ES2): “elasticsearch_cluster_health_status{color=“red”}”.
In the alert message content, I am using the variable {{ $labels.cluster }} to accurately display the cluster that is experiencing an issue when the alert is triggered. However, I am receiving the value “undefined.”
But when I use a query with a filter for a single cluster, ES1, like "elasticsearch_cluster_health_status{cluster=“ES1”, color=“red”}, the variable {{ $labels.cluster }} in the returned message content provides the value ES1.
Can anyone explain to me why this is happening? If I want to use a query for multiple ES clusters to accurately alert which cluster is experiencing an issue with the variable, what should I do?
Thank you in advance!