Skip to Content

What should Datadog monitors about high latency include for an AI SRE?

Tares gets the most from a high latency Datadog monitor when its payload carries a service name, a severity, a summary and a start time. Datadog reaches Tares through the webhook connector and a Datadog-side setup, and Tares has no connector of its own for Datadog today. You write the JSON payload in the Datadog webhook, then map those fields to labels on a Tares webhook source.

How it works

Datadog calls a webhook you define, and the webhook posts to a Tares ingest URL. You write the payload as JSON from Datadog variables such as $ALERT_ID, $EVENT_MSG and $LINK, so the shape is yours. Tares stores the payload lossless and maps the fields you declare into labels.

Four pieces of content are worth putting in a high latency monitor’s payload:

  • A service name. Make it the primary label. In the AI SRE guide, sources that carry the same service label merge into one timeline per service, which is the read an agent works from. Use the same label name and values your metrics and logs sources use.
  • A severity. It tells you how serious the monitor considers the latency.
  • A summary. The monitor message variable $EVENT_MSG is one place to take it from. A short sentence that names the latency problem is enough.
  • A start time. Put it in a field with an ISO-8601 timestamp and point event_time_field at it, so the event carries the time the alert began.

The field names service, severity, summary and started_at are only examples. Use any names you like, as long as the labels in Tares read the same names.

Keep the payload flat. event_type_field and text_template read top-level fields only, so nested objects are harder to use there. The $ALERT_ID and $LINK variables are useful extras, because they let you trace an event back to the monitor in Datadog. The webhook connector page describes the source type in full.

Set it up

  1. In Datadog, open the Webhooks integration and add a webhook whose URL is the Tares ingest URL.
  2. Write the payload as JSON from Datadog variables. Include your service name, severity, summary and start time as flat top-level fields.
  3. If Tares has auth on, add custom headers as JSON in the Datadog webhook, with an Authorization Bearer header that holds an ingest-scoped API key. If Tares has auth off, you need no header.
  4. Put @webhook- followed by your webhook’s name in the monitor message, so the monitor calls the webhook.
  5. In Tares, add a webhook source (Sources → Add source → webhook) with a label for each field you want to correlate on, and mark one as primary. This example uses the example field names from above:
- name: datadog-latency connector: webhook config: event_type: high_latency event_time_field: started_at text_template: '{summary}' labels: - { name: service, field: service, primary: true } - { name: severity, field: severity }
  1. Copy the ingest endpoint from the source page. To check the mapping, post a sample payload to the source’s ingest URL, then read Recent events and Fields on the source page. Fields shows which payload fields arrive and how often.
curl -X POST http://localhost:8787/ingest/<ingest_key> \ -H 'Content-Type: application/json' \ -d '{"service": "checkout", "severity": "critical", "summary": "p99 latency is high", "started_at": "2024-01-01T00:00:00Z"}'

That sample is an example you write yourself. Compare Fields against what a real monitor sends once Datadog calls the webhook, and adjust the labels to match.

What you get

  • Datadog’s high latency alerts arrive in Tares as events with a service label, so they can sit alongside your other sources keyed by the same label.
  • The full payload is stored lossless, so fields you did not map are still there. A link or alert id from Datadog stays with the event.
  • The summary appears as the event text through text_template, and the start time is used as the event time through event_time_field.
  • Fields on the source page shows which payload fields arrive and how often, so you can see whether the service label is reliably present.

When something else fits

  • If Prometheus or Alertmanager already owns your latency alerting, use the prometheus_alerts or alertmanager connectors. They ingest what fires without a payload you write.
  • If you only need generic JSON from a system that can send an HTTP request, the same webhook source works without any Datadog-specific setup.
  • If you want latency values themselves rather than alerts about them, poll them with the prometheus connector instead.

Still stuck? Get help

Last updated on