Skip to content

[Backport release-1.6] fix(monitoring): send alerts to every Alertmanager replica - #4890

Merged
myasnikovdaniil merged 1 commit into
cozystack:release-1.6from
yankawai:backport/vmalert-notify-every-alertmanager-1.6
Oct 14, 2026
Merged

myasnikovdaniil merged 1 commit into
cozystack:release-1.6from
yankawai:backport/vmalert-notify-every-alertmanager-1.6

Conversation

@yankawai

Copy link
Copy Markdown
Contributor

What this PR does

Backport of #4889 to release-1.6. The commit is cherry-picked from 9d4221b. The only conflict was in templates/_helpers.tpl, which is shorter on this branch, so the new monitoring.alertmanager.replicas helper is appended to the release-1.6 file and nothing else from main comes along.

The vmalert and VMAlertmanager templates here are the same as on main before the fix, a single notifier on the shared Service and replicaCount: 3, so the change applies as is. The monitoring chart tests pass on this branch, 7 suites and 50 tests, the new suite included.

Screenshots

Not a UI change.

Downstream repositories

Same diff as #4889, two templates, the helpers and a test file of packages/system/monitoring, so no trigger map entry applies.

Release note

fix(monitoring): vmalert now sends alerts to every Alertmanager replica instead of the shared Service, so the Alertmanager cluster deduplicates them and a long-running alert no longer produces repeated firing and resolved notifications.

vmalert had a single notifier, the headless vmalertmanager-alertmanager
Service. It resolves to all three pods, but each alert reached one replica
at a time and moved to another when vmalert reconnected. On clusters running
1.6.4 all active alerts sat on one replica while the other two had none, and
on one of them the alert count of each replica changed about 170 times a
day. The Alertmanager cluster deduplicates notifications only when every
replica receives every alert. The replica an alert left let it expire and
sent a resolved notification, and the replica it reached sent a new firing
one.

vmalert now lists each Alertmanager pod as its own notifier, using the
<name>-<i>.<service>.<namespace>.svc address the operator itself gives
StatefulSet pods. The replica count comes from one helper that also sets
spec.replicaCount of the VMAlertmanager, so the two cannot drift.

Assisted-by: LLM
Signed-off-by: Yan Bondarenko <[email protected]>
(cherry picked from commit 9d4221b)
@coderabbitai

coderabbitai Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: cozystack/cozystack/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6b2cfde6-8254-4b4a-9f0f-7d5041fe55ad

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added area/monitoring Issues or PRs related to the monitoring stack (vlogs, vmstack, grafana, workloadmonitor) area/release Issues or PRs related to release tooling (changelog, backport, release pipeline) kind/bug Categorizes issue or PR as related to a bug labels Oct 12, 2026
@myasnikovdaniil
myasnikovdaniil merged commit 858478c into cozystack:release-1.6 Oct 14, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/monitoring Issues or PRs related to the monitoring stack (vlogs, vmstack, grafana, workloadmonitor) area/release Issues or PRs related to release tooling (changelog, backport, release pipeline) kind/bug Categorizes issue or PR as related to a bug size/M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants