projectsyn / component-prometheus

Commodore component to wrap kube-prometheus jsonnet library.
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Add label selectors for monitors and rules #31

Closed glrf closed 2 years ago

glrf commented 2 years ago

We introduce a opt-in and opt-out labeling system for prometheusrules and monitors.

Pod and Service Monitors are opt-out. By setting monitoring.syn.tools/enabled: "false" we can make Prometheus ignore a monitor, even if the namespace it labeled to be monitored.

PrometheusRules are opt-in. Prometheus will only pick up rules if they are in a monitored (i.e. labeled) namespace AND the rule is labeled with monitoring.syn.tools/enabled: "true". This should ensure that rules are added consciously and prevent a massive import of upstream alerts that are not actionable or don't meet our standards.

Checklist