What should Datadog monitors about failed deploys include for an AI SRE?
Tares works best when a Datadog monitor about a failed deploy sends a flat JSON payload with four things: a service name, a severity, a summary and a start time. Datadog reaches Tares through the webhook connector and a Datadog setup, because Tares has no connector of its own for Datadog today. The service name ties the alert to the same timeline as your metrics and logs, so the agent can match the failed deploy to evidence.
How it works
A Datadog webhook posts to a Tares webhook source. You write the payload yourself in the webhook Payload field, so its shape is yours. Datadog variables such as $ALERT_ID, $EVENT_MSG and $LINK are available to fill it. Tares stores the payload lossless and maps the fields you declare as labels into the envelope.
Four fields do the work for an AI SRE:
- Service name. Declare it as the primary label. Tares builds one timeline per service when your sources carry the same service label. A failed-deploy alert that carries the same service value as your metrics, logs and alerts lands on that timeline, next to the evidence. Use exactly the value your other sources use, for example
checkoutin both places. - Severity. A label that tells the agent how urgent the alert is. Triggers and filters can read it.
- Summary. A short sentence of what failed.
$EVENT_MSGis a natural source for it. Tares shows it as the event text through a text template. - Start time. An ISO-8601 timestamp of when the failure began. Point
event_time_fieldat it, so the event sits at the right moment on the timeline. The agent can then see that a deploy landed, errors began two minutes later, and the alert fired after that.
Keep the payload flat. event_type_field and text_template read top-level fields only, so a nested object cannot feed them. If you want a link back to the monitor, send $LINK as one more top-level field. It stays in the payload for the agent to read.
On a secured instance, Datadog sends an Authorization Bearer header holding an ingest-scoped API key as a custom header. That header is the credential. Without auth on Tares, the header is not needed. The webhook connector page covers the source in full.
Set it up
- In Tares, create a webhook source with a primary
servicelabel and a label for severity. Set a fixed event type for these alerts, a text template over your summary and severity, and the field that holds the start time.
- name: datadog-deploys
connector: webhook
config:
event_type: deploy_failed
event_time_field: started_at
text_template: '{service} {severity}: {summary}'
labels:
- { name: service, field: service, primary: true }
- { name: severity, field: severity }- Copy the ingest endpoint from the source page. It has the form of the URL in the next step.
- Post a sample payload to the ingest URL, with the fields your Datadog payload will carry. If Tares has auth on, add the Bearer header with an ingest-scoped API key.
curl -X POST http://localhost:8787/ingest/<ingest_key> \
-H 'Content-Type: application/json' \
-d '{"service": "checkout", "severity": "critical", "summary": "Deploy failed", "started_at": "2024-01-01T00:00:00Z"}'- Open the source page and read Recent events and Fields. Recent events shows the stored sample, and Fields shows which payload fields arrive and how often. Check that the service label has the value your other sources use.
- In Datadog, open the Webhooks integration and add a webhook whose URL is the Tares ingest URL.
- Write the payload as JSON from Datadog variables, with the service, severity, summary and start time as top-level fields. When Tares has auth on, add custom headers as JSON with an Authorization Bearer header holding an ingest-scoped API key.
- Put the webhook in the monitor message so the monitor calls it. The mention is
@webhook-followed by the name you gave the webhook.
Then follow the AI SRE guide to add a trigger that wakes an agent on service-keyed events.
What you get
- Failed-deploy alerts appear as events on the timeline of the service they belong to, merged with metrics, logs and other alerts on one clock.
- The agent reads the severity, the summary and the start time in one place, and can tie the alert to the evidence around that moment.
- Triggers can filter on the severity label or the event type, so you decide which deploy failures wake an agent.
- The full payload stays stored lossless. Fields you did not map are still there if you add a label later.
- Datadog keeps owning the monitor. Tares ingests what fired and correlates it.
When something else fits
- If a source can send a CI or CD event itself, post straight to a webhook source from your pipeline. The AI SRE guide shows a deploy event with a service, commit and author. A Datadog monitor adds the failure signal and the CD event adds the cause.
- If your alerts already flow through Alertmanager or Prometheus rules, their own connectors fit better than a hand-written Datadog payload.