Problem
When enabling prometheusRule in the helm values, the alert labels are limited to severity, namespace and cnpg_cluster. This lack of options forces the user to use external logic (kustomize patch) to generate the correct labels on alerts.
Proposed solution
Add a field named addAlertExtraLabels in cluster.monitoring.prometheusRule to allow passing custom labels as an object.
Example values :
cluster:
monitoring:
prometheusRule:
enabled: true
addAlertExtraLabels: # {}
# example custom labels
alert_email: "true"
environment: staging
Template prometheus_rule :
...
labels:
severity: critical
namespace: {{ .namespace }}
cnpg_cluster: {{ .cluster }}
{{- range $key, $val := .addAlertExtraLabels }}
{{ $key }}: {{ $val | toString }}
{{- end }}
...
I will create the PR linked to this feature.
Problem
When enabling
prometheusRulein the helm values, the alert labels are limited toseverity,namespaceandcnpg_cluster. This lack of options forces the user to use external logic (kustomize patch) to generate the correct labels on alerts.Proposed solution
Add a field named
addAlertExtraLabelsincluster.monitoring.prometheusRuleto allow passing custom labels as an object.Example values :
Template prometheus_rule :
I will create the PR linked to this feature.