feat(chart): configurable alert-rule exclusions and opt-in keep_firing_for - #553
Merged
Conversation
…g_for Two additive knobs on the default nb alert rules, both no-ops unless set (default render is byte-identical to the previous chart): - alertmanager.extra_rule_exclusions: list of terms appended to the container_id exclusion regex of both the log-error and HTTP-failure rules. Lets installs with demo/synthetic-load apps that fail on purpose (e.g. otel-demo load generators) exclude them without forking the default rules. - alertmanager.rule_keep_firing_for: opt-in keep_firing_for on the two flap-prone rules (ApplicationAPIFailures, HighErrorCriticalLogs), so an intermittently failing target stays one steady alert instead of resolve/re-fire churn (~8 re-fires/hour observed on a single flaky endpoint). Off by default: Prometheus < 2.42 rejects rule files containing the field, and some PrometheusRule consumers (VM operator < v0.46) drop it in conversion, so it must only be enabled where every rule evaluator in the cluster is known to support it.
Contributor
|
📦 Image Tags Updated |
There was a problem hiding this comment.
Code Review
This pull request introduces configurable alert exclusions (extra_rule_exclusions) and an opt-in keep_firing_for duration for Prometheus alert rules to prevent alert flapping. The feedback highlights a critical issue where empty strings in the exclusion list could lead to empty regex alternations, silently disabling alerts across the cluster. It is recommended to use the compact function to sanitize the list before joining it.
Contributor
|
📦 Image Tags Updated |
An empty list entry would render an empty regex alternation ("||" or a
trailing "|"), which matches every container_id and would silently
disable both rules cluster-wide. compact filters them out; an all-empty
list now degrades to the default regex instead.
Contributor
|
📦 Image Tags Updated |
blue4209211
approved these changes
Jul 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two additive values knobs on the default nb alert rules (
prometheus-alert-rule.yaml). Both are no-ops unless set — the default render is byte-identical to the current chart (verified by diffinghelm templateoutput againstorigin/main).alertmanager.extra_rule_exclusions(default[])List of alternation terms appended to the container_id exclusion regex of both the log-error and HTTP-failure rules. Terms match as substrings of
container_id(/k8s/<namespace>/<pod>/<container>), so a namespace name excludes that namespace.Motivation: clusters running demo/synthetic-load apps that fail on purpose (e.g. otel-demo load generators) flood ApplicationAPIFailures — on dev-GKE two load-generator pods alone produced ~19.5k alert activations in 7 days on
/api/cart. This lets such installs exclude them without forking the default rules.alertmanager.rule_keep_firing_for(default""— opt-in)When set (e.g.
"10m"), emitskeep_firing_foron the two flap-prone rules (ApplicationAPIFailures, HighErrorCriticalLogs) so an intermittently failing target stays one steady alert instead of resolve/re-fire churn (~8 re-fires/hour observed on a single flaky endpoint in dev).Off by default for provider compatibility: Prometheus < 2.42 rejects rule files containing the field (taking down the whole rule group), and some PrometheusRule consumers drop it (VictoriaMetrics operator < v0.46 drops it in PrometheusRule→VMRule conversion — verified empirically on v0.45.0). Only enable where every rule evaluator in the target cluster supports it.
Validation
helm templatedefault render diffed byte-identical vsorigin/mainrule_keep_firing_for=10m→ field emitted on exactly the 2 intended rules;""→ omitted entirely (note: template reads the value directly — sprigdefaultwould swallow the empty-string disable path)