prometheus-community / helm-charts

Prometheus community Helm charts
Apache License 2.0
4.97k stars 4.98k forks source link

[kube-prometheus-stack] Regex error for appNamespacesTarget: #4244

Open alexiiiiiiiiiiiiiii opened 6 months ago

alexiiiiiiiiiiiiiii commented 6 months ago

In the kube-prometheus-stack, I want to disable alerts coming from namespaces beginning with "dedicated-" so in the values I set

## Reduce app namespace alert scope
appNamespacesTarget: "^(?!dedicated-).*"

But it returned me this error :

Error: UPGRADE FAILED: cannot patch "monitoring-kube-prometheu-kubernetes-apps" with kind PrometheusRule: admission webhook "prometheusrulemutate.monitoring.coreos.com" denied the request: Rules are not valid && cannot patch "monitoring-kube-prometheu-kubernetes-storage" with kind PrometheusRule: admission webhook "prometheusrulemutate.monitoring.coreos.com" denied the request: Rules are not valid

Is my regex wrong or just not working for golang ?

adberger commented 1 month ago

Maybe this will help: https://www.robustperception.io/negative-lookahead-assertions-in-promql-selectors/