How do I wake an AI SRE once when Alertmanager alert groups report failed deploys?
Tares wakes your AI SRE once per entity when Alertmanager reports failed deploys: you point an Alertmanager receiver at an alertmanager source and add a trigger with a cooldown. Each alert becomes one event, and the trigger evaluates per entity. While the alert keeps repeating inside the cooldown, the same entity does not fire again. Resolved alerts are still recorded as events, so the timeline shows the full firing to resolved story.
How it works
- One event per alert. Alertmanager POSTs a batch with an
alertsarray. The alertmanager source in Tares splits it into one event per alert. Theevent_typeis the alert name, thetextis its summary, and the alert labels become Tares labels plus a syntheticstatusoffiringorresolved. The full alert, includingfingerprint, stays in the payload. See Alertmanager for the connector details. - One entity per service. Tares derives the entity key from a label, in the order
namespace,service,job,instance, or from a label you declareprimary. You can also setkey_labelon the source. - One firing per entity per cooldown. A trigger checks its condition as events arrive. With
group_by: [key_value]it evaluates per entity, andcooldownis the minimum gap between firings for the same entity. A repeating failed-deploy alert forprodfires once, then stays quiet for that entity until the cooldown passes. A different entity fires on its own. - Context with the wake-up. When the trigger fires, Tares POSTs a dispatch to each subscriber. The
payloadis the entity’s correlated timeline overcontext_window, so the agent starts with the context it needs and makes no follow-up call. - Resolved events land on the timeline. With
send_resolved: true, Alertmanager sends the resolved notification, and Tares stores it as an event withstatusset toresolved. It shows up in Recent events and in the correlated timeline next to your other sources.
Set it up
- Create the source. Ask a connected agent: “Use tares to create an Alertmanager source and give me the webhook URL.” Or use Sources → Add source → Alertmanager alerts, name it and select Create. The source page shows a receiver block with the ingest URL filled in.
- Add the receiver to
alertmanager.ymland reload Alertmanager. Keepsend_resolved: trueso resolved alerts reach the timeline:
receivers:
- name: tares
webhook_configs:
- url: http://localhost:8787/ingest/<ingest_key>
send_resolved: true
route:
receiver: tares- If your Tares instance has auth on, the sender uses a Bearer
Authorizationheader holding aningest-scoped API key. The source page shows the matching block. Without auth you need nothing more. - Send a test batch and check Recent events:
curl -X POST http://localhost:8787/ingest/<ingest_key> \
-H 'Content-Type: application/json' \
-d '{"alerts":[{"status":"firing","labels":{"alertname":"PostgresDown","severity":"critical","namespace":"prod"},"annotations":{"summary":"Postgres is down"},"startsAt":"2024-01-01T00:00:00Z"}]}'- Open Fields on the source and promote
namespaceorserviceas the label to correlate on. - Add the trigger on the project’s page, under Triggers → Add trigger, or in the catalog YAML. Replace
DeployFailedwith the alert name your rule uses, anddeploy-alertswith your source name:
triggers:
- name: failed_deploy
sources: [deploy-alerts]
key_field: namespace
filters:
- { field: event_type, op: contains, value: DeployFailed }
condition:
aggregate: count
predicate: "> 0"
window: 5m
group_by: [key_value]
emit:
kind: failed_deploy
context_window: 15m
cooldown: 30m- Subscribe the agent. A Tares agent is woken by the trigger once you wire it to the trigger in a project and turn it on. An external agent registers a webhook with the
subscribetool: “Use tares to subscribe to thefailed_deploytrigger and deliver tohttps://my-agent.example.com/hook.”
The filter matches on event_type only, so firing and resolved alerts of the same name both stay in the timeline handed to the agent. Filters narrow which events are handed over, so a filter on status would drop the resolved events from the payload.
Choose the cooldown to match how long a failed deploy normally takes to be fixed or retried. Every firing is logged on the trigger’s page under Firings, even with zero subscribers, so you can check how often the trigger fires and tune the value.
What you get
- One investigation per entity for a repeating failed-deploy alert, instead of one per Alertmanager repeat.
- Independent firing per entity, so a failed deploy in
proddoes not hide one instaging. - A dispatch whose payload is the entity’s correlated timeline: the failed-deploy alerts, the resolved notification when it arrives, and events from your other sources over the context window.
- A record of every firing and every delivery outcome in the console, plus a dispatch page with the exact payload sent.
- Delivery you can rely on: at-least-once, retried on 5xx and transport errors, so dedupe on
dispatch_idin your endpoint.
When something else fits
- If you want Tares to poll Prometheus for fired alerts on a clock instead of receiving Alertmanager’s grouping and resolved handling, use the
prometheus_alertsconnector. - If you want a periodic summary instead of a reaction to each failure, give the trigger a schedule with
condition: {every: 10m}, as described in Watch with triggers. - For the wider picture of how Tares investigates incidents, start at AI SRE.