What should an AI SRE read next to alerts from Prometheus for crash loops?
Tares puts the same service’s metrics, logs and recent deploys on one timeline next to a Prometheus crash loop alert, so an AI SRE reads that evidence and cites it. The alert says that something is wrong. The neighboring events say why, and the diagnosis points at specific lines. You get this by labeling every source with the same service label.
How it works
The prometheus_alerts connector polls Prometheus’s own alerts endpoint, so the alerts your rules have already fired arrive in Tares. Prometheus keeps deciding what counts as a crash loop alert. Tares ingests it and correlates it.
- Each active alert becomes one event. The
event_typeis the alert name, thetextis its summary, and the alert’s labels become Tares labels. Tares adds astatelabel offiring,pendingorresolved. - State is tracked across polls. A crash loop alert fires once and re-emits only when its state changes. When it clears, you get a
resolvedevent instead of a copy on every poll. - Sources that carry the same
servicelabel merge into one timeline per service, on one clock. - Next to the alert, an AI SRE reads three kinds of evidence for that service:
- Metrics from the
prometheusconnector, polled for the service. - Logs from the container through
docker_logs, or from your OpenTelemetry pipeline through OTLP. - Recent changes, such as deploys and config changes, posted to a
webhooksource.
- Metrics from the
The change source is the one worth adding first. Most real root causes are a change, and a deploy event placed just before the alert lets the agent say when the failures started and what landed just before. See Build an AI SRE for the full walkthrough.
Set it up
-
Start Tares and open the console.
tares up -
Add the alerts source under Sources, Add source, Prometheus alerts. Enter your Prometheus
urland run Discover. You can filter by severity and turn on include pending to also ingest alerts that are still waiting out theirfor:duration. The source looks like this:- name: alerts connector: prometheus_alerts poll: 30s config: url: http://localhost:9090 severities: critical,warning # blank = all labels: - { name: severity, field: labels.severity, primary: true } - { name: state, field: state } -
Let a few alerts arrive, then open the source’s Fields tab. An alert’s dynamic labels, such as
namespaceandservice, exist only while it fires, so you promote them from there. Promoteserviceso the alert lands on the right timeline. Prometheus alerts covers the source in detail. -
Add the evidence sources and give each one the same
servicelabel:- a
prometheussource for the service’s metrics, - a
docker_logssource for its container logs, or anotlpsource, - a
webhooksource for deploys, with a primaryservicelabel andevent_typeset to deploy. Call its ingest URL from your delivery pipeline on every deploy.
- a
-
Open Explore and pick the service. The alert, metrics, logs and deploy events appear merged on one clock. Check that the crash loop alert sits among the others.
-
Connect your agent for on-demand investigation. Start the MCP endpoint in a second shell.
tares mcpThen ask your client what happened to the service in the last 15 minutes. It answers from the correlated read.
-
To wake an agent automatically, create a trigger over the three sources, keyed by
service, that fires when an alert event arrives. You choose who is woken: a Tares agent, your own agent service over a webhook, or a Slack channel.
What you get
- One timeline per service, with the crash loop alert beside the metrics, logs and deploys for the same service.
- A diagnosis that cites evidence. The agent ties the failure to specific lines on the timeline, not to the alert text alone.
- Alerts that stay readable. Each alert fires once, and a
resolvedevent marks when it cleared. - A change in view. A deploy event sits just before the alert, so the agent can name it as a likely cause.
- A loop that learns. The agent writes its finding back onto the service’s timeline, so the next investigation starts from the previous conclusion instead of from scratch.
- Alerting stays where it is. Prometheus keeps owning the rules, and Tares does not re-threshold anything.
When something else fits
- If you route alerts through Alertmanager and want to keep that path, the
alertmanagerconnector takes what it sends to a Tares ingest URL. Use it instead of polling Prometheus. - If you want to react to the raw numbers instead of a fired alert, write a trigger on the typed metric fields from the
prometheussource. Theprometheus_alertssource suits teams whose crash loop rules already exist.