prometheus-community / helm-charts

Prometheus community Helm charts
Apache License 2.0
5.12k stars 5.02k forks source link

[kube-prometheus-stack] Support set alert rule specific labels and annotations #4873

Closed bougou closed 1 month ago

bougou commented 1 month ago

What this PR does / why we need it

Currently, the kube-prometheus-stack helm chart supports adding custom labels/annotations globally for all alert rules, and adding custom labels/annotations per alert rule group. It lacks the ability to add custom labels and/or annotations for specific alert rule.

This PR adds the ability to add custom labels and/or annotations for specific alert rule.

Which issue this PR fixes

(optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged)

Special notes for your reviewer

Checklist

jkroepke commented 1 month ago

Hi @bougou

thanks for your PR. Did you notice the header of each rule?

{{- /*
Generated from 'alertmanager.rules' group from https://github.com/prometheus-operator/kube-prometheus.git
Do not change in-place! In order to change this file first read following link:
https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack/hack
*/ -}}
bougou commented 1 month ago

Hi @bougou

thanks for your PR. Did you notice the header of each rule?

{{- /*
Generated from 'alertmanager.rules' group from https://github.com/prometheus-operator/kube-prometheus.git
Do not change in-place! In order to change this file first read following link:
https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack/hack
*/ -}}

@jkroepke Sorry, I didn't notice the warning. I will read the link and follow its instructions there. I will close this PR.