Skip to Content

What should Datadog monitors about crash loops include for an AI SRE?

Tares gets the most from a Datadog crash loop monitor when its webhook payload carries a service name, a severity, a summary and a start time. Datadog reaches Tares through the webhook connector and a vendor setup, because Tares has no connector of its own for Datadog today. With those four fields, the agent places the alert on the service’s timeline next to its metrics and logs and ties it to evidence.

How it works

In Datadog you add a webhook whose URL is a Tares ingest URL. You write the payload as JSON in the webhook Payload field, built from Datadog variables such as $EVENT_MSG and $LINK, so the shape is yours. That means you decide what a crash loop alert says. Four fields make it useful to an agent:

  • Service name. This is the label that matters most. Tares builds one timeline per service, so an alert whose service value matches the service label on your metric and log sources lands on the same timeline as that evidence. Mark it as the primary label.
  • Severity. It tells a trigger or the agent whether a crash loop is a page or a note. Declare it as a label so you can filter on it.
  • Summary. A short sentence, for example which workload is restarting. Use it as the event text with text_template, so the timeline reads clearly. Datadog’s $EVENT_MSG variable is a natural source for it.
  • Start time. Send it as an ISO-8601 timestamp and point event_time_field at it. The event then sits at the moment the loop began, not the moment Tares received it. The agent can compare that moment with deploys, config changes and log errors.

Keep the payload flat. event_type_field and text_template read top-level fields only, so nested objects cannot drive the event type or the text. Tares stores the full payload lossless either way, so you can add the $LINK variable as an extra field for a human to follow. See the webhook connector page for every setting.

Set it up

  1. Create a webhook source in Tares (Sources → Add source → webhook), or ask a connected agent to create one. Declare a label for each field your payload carries and mark one as primary, normally the service. Copy the ingest endpoint from the source page.
- name: ci-events connector: webhook config: event_type_field: action text_template: '{action} by {sender}' labels: - { name: pipeline, field: pipeline, primary: true }

This is the shape of a webhook source. For crash loops, name your own labels after your payload fields: one for the service as primary, one for the severity. Set text_template to render your summary field, and event_time_field to the field that holds the start time. Use a fixed event_type if you prefer one event type for all crash loop alerts.

  1. In Datadog, open the Webhooks integration and add a webhook whose URL is the Tares ingest URL.
  2. Write the payload as flat JSON from Datadog variables, with the service, severity, summary and start time as top-level fields.
  3. If Tares has auth on, add custom headers as JSON with an Authorization Bearer header that holds an ingest-scoped API key. Creating a push source in the console mints one and shows it once. Without auth on, no header is needed.
  4. Put @webhook- followed by your webhook name in the monitor message, so the monitor calls the webhook when it fires.
  5. Check the mapping. Post a sample payload to the ingest URL, then open the source page and read Recent events and Fields. Fields shows which payload fields arrive and how often, so you can confirm the service, severity, summary and start time all come through.
curl -X POST http://localhost:8787/ingest/<ingest_key> \ -H 'Content-Type: application/json' \ -d '{"action": "deploy", "sender": "ci", "pipeline": "web"}'

Swap in a sample of your own crash loop payload as the body.

  1. Make sure your metric and log sources use the same service label, then add a trigger over them keyed by service. The AI SRE guide walks through that wiring end to end.

What you get

  • Crash loop alerts that land on the right service’s timeline, merged on one clock with metrics, logs and deploys.
  • An event time that matches when the loop started, so the agent can line it up with a deploy or config change.
  • A readable summary on every event, and a severity you can filter on in a trigger.
  • The complete Datadog payload stored lossless, so a field you did not label is still there when an investigation needs it.
  • An agent that can tie the alert to specific evidence lines instead of starting from a bare monitor name.

When something else fits

  • If your crash loop alerts already flow through Prometheus rules, the prometheus_alerts or alertmanager connectors take them with their labels and annotations, with no payload to write.
  • If the monitor can only post a deeply nested payload you cannot flatten, expect to use labels with one-level dotted fields, and a fixed event_type instead of event_type_field.

Still stuck? Get help

Last updated on