Skip to content

feat(chart): configurable alert-rule exclusions and opt-in keep_firing_for - #553

Merged
blue4209211 merged 3 commits into
mainfrom
fix/alert-rule-extra-exclusions
Jul 30, 2026
Merged

feat(chart): configurable alert-rule exclusions and opt-in keep_firing_for#553
blue4209211 merged 3 commits into
mainfrom
fix/alert-rule-extra-exclusions

Conversation

@mayankpande88

Copy link
Copy Markdown
Contributor

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 diffing helm template output against origin/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"), emits 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 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 template default render diffed byte-identical vs origin/main
  • exclusions set → terms appended in all 7 regex occurrences (3× API rule, 4× log rule)
  • rule_keep_firing_for=10m → field emitted on exactly the 2 intended rules; "" → omitted entirely (note: template reads the value directly — sprig default would swallow the empty-string disable path)
  • rendered output parses as valid YAML

…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.
@mayankpande88
mayankpande88 requested a review from a team as a code owner July 30, 2026 15:38
@github-actions

Copy link
Copy Markdown
Contributor

📦 Image Tags Updated

I've automatically updated the image tags in `charts/nudgebee-agent/values.yaml` to the latest versions from GHCR for the `main` branch.

The image tags are now synchronized with the latest builds and ready for release.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread charts/nudgebee-agent/templates/prometheus-alert-rule.yaml
@github-actions

Copy link
Copy Markdown
Contributor

📦 Image Tags Updated

I've automatically updated the image tags in `charts/nudgebee-agent/values.yaml` to the latest versions from GHCR for the `main` branch.

The image tags are now synchronized with the latest builds and ready for release.

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.
@github-actions

Copy link
Copy Markdown
Contributor

📦 Image Tags Updated

I've automatically updated the image tags in `charts/nudgebee-agent/values.yaml` to the latest versions from GHCR for the `main` branch.

The image tags are now synchronized with the latest builds and ready for release.

@blue4209211
blue4209211 merged commit 1750a11 into main Jul 30, 2026
6 checks passed
@blue4209211
blue4209211 deleted the fix/alert-rule-extra-exclusions branch July 30, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants