What should Alertmanager alert groups about slow database queries include for an AI SRE?
Tares records each alert in an Alertmanager group as its own event, so slow database query alerts should carry a service label, a severity label, a summary and a start time. The service label ties the alert to the same service’s metrics and logs. The summary becomes the event text, and the start time and status show when the problem began and whether it resolved.
How it works
Alertmanager POSTs a batch to your Tares ingest URL. Tares splits the alerts array into one event per alert, so each field you send has a place to land:
- Alert name. The
alertnamelabel becomes the event type. Name the alert for what it detects, for exampleSlowDatabaseQueries, so the event reads clearly on the timeline. - Summary. The
summaryannotation becomes the event text. Write one plain sentence that says what is slow. - Service. Alert labels become Tares labels. Tares picks the entity key from
namespace, thenservice, thenjob, theninstance, or from a label you declare as primary. Aservicelabel that matches the label on your metric and log sources puts the alert on the same per-service timeline as that evidence, which is what the AI SRE guide builds on. - Severity. A
severitylabel arrives as a Tares label like any other, so triggers and agents can read it. - Start time.
startsAtis part of the alert and is kept in the payload. - Status. Tares adds a
statuslabel,firingorresolved. Withsend_resolved: trueyou see both states.
The full alert, including its fingerprint, stays in the payload, so nothing you send is lost.
If an alert carries both namespace and service, the default key is namespace. To key on service instead, set the advanced key_label field on the source to service.
Set it up
- Create the source. Ask a connected agent: “Use tares to create an Alertmanager source and give me the webhook URL.” Or open Sources → Add source → Alertmanager alerts, name it and click Create. The source page shows a receiver block with your ingest URL filled in.
- Add the receiver to your
alertmanager.ymland reload Alertmanager:
receivers:
- name: tares
webhook_configs:
- url: http://localhost:8787/ingest/<ingest_key>
send_resolved: true
route:
receiver: tares- If Tares runs with auth on, the sender uses a Bearer Authorization header holding an ingest-scoped API key. The source page shows the auth block for you. Without auth, you need nothing more.
- In the alert rule for slow queries, set the labels
serviceandseverity, and asummaryannotation. Alertmanager suppliesstartsAtitself when it delivers the alert. - Send a test batch shaped like a slow query alert:
curl -X POST http://localhost:8787/ingest/<ingest_key> \
-H 'Content-Type: application/json' \
-d '{"alerts":[{"status":"firing","labels":{"alertname":"SlowDatabaseQueries","severity":"warning","service":"checkout"},"annotations":{"summary":"Database queries are slow"},"startsAt":"2024-01-01T00:00:00Z"}]}'- Open Recent events to see the event, then open Fields to see the alert labels. Promote
servicethere so the alert correlates with your other sources. The Alertmanager connector page lists every field.
What you get
- Each slow query alert is one event with a clear type, a readable summary and its labels, instead of a single opaque group.
- The alert sits on the service’s timeline next to metrics and logs on one clock, so an agent can tie it to evidence.
- The
statuslabel shows whether the alert is still firing or has resolved. - A trigger can fire on the alert event and wake an agent, which reads the correlated timeline and records its conclusion for the next investigation.
- Alertmanager keeps its grouping, deduplication and silencing. Tares records what Alertmanager sends and does not re-threshold anything.
When something else fits
- If you do not run Alertmanager, the
prometheus_alertsconnector polls the alerts your Prometheus rules have fired, every 30 seconds by default. Alertmanager is the better fit when you want its grouping, silencing, resolved handling and real-time delivery. - If the alert comes from a tool that is not Alertmanager, send it through the
webhookconnector and keep the payload flat, with the same service, severity, summary and start time fields.