Problem:
The client has encountered an issue where a label, specifically “app_kubernetes_io_part_of”, is not being evaluated in the alert description or labels despite being present in the metric. They seek clarification on whether this behavior aligns with the expected functionality of Prometheus alerts.
Process:
app_kubernetes_io_part_of
label.sum by
clause, the label’s value started appearing in the alert description.Solution:
The expert confirmed that the observed behavior aligns with Prometheus’s design for label inclusion in alerts. Labels used in alert annotations or labels must be included in the aggregation operator clause of the alert expression. Therefore, only labels included in the sum by
or similar clauses can be utilized in alert descriptions or labels.
Conclusion:
This clarification helps ensure the correct usage of labels in Prometheus alerts, providing clarity for future alert rule configurations.