Page MenuHomePhabricator

Add a dedicated Toolforge alertmanager instance
Closed, DeclinedPublic

Description

Tool-maintainers alerts (T432860: ST5.4.2 Toolforge Alerting System) are evaluated on the Toolforge Prometheus instance, but they are routed through the Metricsinfra alertmanager instance, then delivered to the Toolforge Alerting Service (details of this flow are being discussed in T432865: Email tool maintainers when an alert condition is detected).

In T432863#12227706, @dcaro argued that this setup does not satisfy several principles: redeployability, self-containment, and having different instances for different audiences. To improve this, @taavi suggested we could add a dedicated alertmanager instance running in Toolforge k8s.

Why

When

I'm filing this task as a sub-task of T432860: ST5.4.2 Toolforge Alerting System, but this task is not a blocker for delivering the hypothesis. If we're tight with time, this task can be pruned from the parent task, and re-prioritized for the following quarter (Q2 26/27).

Scope

  • Add a new alertmanager instance to Toolforge (including tools, toolsbeta and lima-kilo), as a k8s component that can be deployed with toolforge-deploy
  • Point the existing Toolforge Prometheus instances at it, in addition to the Metricsinfra alertmanager (Prometheus supports fanning out to multiple alertmanagers)
  • Both alertmanagers will receive all alerts, the Metricsinfra alertmanager will be configured to discard the alerts with {audience: tool-maintainers} (already tested in T434801: [metricsinfra] allow custom routing for Toolforge alerts), whereas the new Toolforge alertmanager will keep those and discard all the others

Out of scope

  • Adding a new Prometheus instance, dedicated to maintainer alerts. All alerts will stay on the existing Toolforge Prometheus instances (VMs in tools and toolsbeta, not available in lima-kilo)
  • Deploying a Prometheus instance in lima-kilo (possibly inside k8s). This would make the full alerting flow (metric -> alert firing -> email generation) reproducible in the dev environment. Keeping it out of scope because it adds significant complexity, and we can still test the alertmanager/Alerting Service interaction without it, by sending JSON payloads to alertmanager.

Open questions

  • Do we need HA for alertmanager (i.e. two pods in k8s, talking with the native gossip protocol)? I propose to start with a single replica: even if the alertmanager pod goes down, we would not be losing alerts as prometheus would send them again, but tool maintainers could receive a duplicate email earlier than repeat_interval. Silences would also be lost in a pod restart, but we're not planning to use them for now.

Event Timeline

Not needed for the MVP, might be a follow up task for the Alert Service. We should re-assess later.

Closing as Declined as in the end we decided not to use Alertmanager at all (see discussion in T432865: Email tool maintainers when an alert condition is detected).