mirror of https://github.com/grafana/loki
Helm: add additionalRuleLabels to PrometheusRule alerts (#9020)
**What this PR does / why we need it**: Adds the ability to specify other labels on the Prometheus alerts. Specifying: ```yaml monitoring: rules: additionalRuleLabels: custom_label: custom_value ``` will add it to all alerts: ```yaml - alert: LokiRequestErrors annotations: ... expr: ... for: 15m labels: severity: critical custom_label: custom_value ``` This approach is inspired by: [kube-prometheus-stack/rules](https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/templates/prometheus/rules-1.14/general.rules.yaml) Though in their case they run [sync_prometheus_rules.py](https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/hack/sync_prometheus_rules.py) to create the `tpl`. I can understand if this is not the approach (manual) you want to take as editing the tpl adding the labels everywhere and escaping go tpl `{{ }}` is quite painful. **Which issue(s) this PR fixes**: N/A **Special notes for your reviewer**: **Checklist** - [x] Reviewed the [`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md) guide (**required**) - [x] Documentation added - [x] Tests updated - [ ] `CHANGELOG.md` updated - [x] Changes that require user attention or interaction to upgrade are documented in `docs/sources/upgrading/_index.md`pull/8984/head^2
parent
9eca39601d
commit
f785faa820
Loading…
Reference in new issue