Hi,
I have set external labels as below in my Prometheus configuration.
externalLabels:
deployment_env: dev
org_id: myOrganization
...
and in my rules.yaml I am trying to access external labels like below.
- alert: ClusterCapacityWarning
annotations:
summary: "Available capacity of cluster on {{ $externalLabels.deployment_env }} is Low."
description: "Capacity of cluster {{ $externalLabels.org_id }} is less than 20%."
expr: |
(cluster_resource_capacity_available < 20)
for: 5m
labels:
severity: warning
but doing above I get the error
function externalLabels.deployment_env not found
what am I doing wrong? Have anyone been in a similar situation before?
Even in Prometheus docs states that The configured external labels can be accessed via the $externalLabels variable.
Thanks