How do I test Datadog monitors about high latency before a real incident?
Tares lets you rehearse a Datadog high latency monitor by posting a sample payload to the source’s ingest URL, so you see the event before a real incident. Datadog reaches Tares through the webhook connector and a vendor setup, and Tares has no connector of its own for Datadog today. After the post, you check the label mapping under Fields and the event under Recent events on the source page.
How it works
A Datadog monitor reaches Tares through a Datadog webhook that posts JSON to a Tares webhook source. You write the payload yourself in the Datadog webhook Payload field, using Datadog variables, so the shape is yours. Tares stores the payload lossless and maps the fields you declare as labels into the event.
The webhook source gives you these checks:
- Recent events on the source page shows each event that arrived.
- Fields shows which payload fields arrive and how often, so you can pick a reliable key.
- Labels map payload fields into the event. Mark one label
primary. event_type_fieldandtext_templateread top-level fields only, so keep the payload flat.
For a push source such as the webhook, test_source takes no payload and only returns the ingest endpoint. It does not check the label mapping. To check the mapping, post a sample payload to the ingest URL and read Recent events and Fields. This is the whole test loop, and it runs without Datadog involved.
Set it up
-
Create the webhook source. Go to Sources → Add source → webhook, or ask a connected agent to create a webhook source and give you the ingest URL. Declare a label for each payload field you want to correlate on, and mark one
primary. The inbound webhook connector page lists every option. -
Declare the source. This example is the shape to follow, with the field names replaced by the ones your Datadog payload carries:
- name: ci-events
connector: webhook
config:
event_type_field: action
text_template: '{action} by {sender}'
labels:
- { name: pipeline, field: pipeline, primary: true }-
Copy the ingest endpoint from the source page.
-
Post a sample payload that mirrors what your Datadog webhook will send. Use the same flat structure and the same field names you plan to write in the Datadog Payload field:
curl -X POST http://localhost:8787/ingest/<ingest_key> \
-H 'Content-Type: application/json' \
-d '{"action": "deploy", "sender": "ci", "pipeline": "web"}'-
Open the source page. Read Recent events to confirm the event arrived with the event type and text you expect. Read Fields to confirm each payload field you mapped shows up. Fix the labels,
event_type_fieldortext_template, post again and repeat until the event looks right. -
If your Tares instance has auth on, send the sample post with an
Authorization: Bearerheader that holds an ingest-scoped API key. Without auth, no header is needed. -
Wire up Datadog once the mapping is right:
- 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. When Tares has auth on, add custom headers as JSON with an Authorization Bearer header that holds an ingest-scoped API key.
- Put
@webhook-followed by your webhook name in the high latency monitor message, so the monitor calls the webhook.
On a secured instance, the Authorization Bearer header is the credential for the Datadog webhook.
What you get
- A checked label mapping before any real alert arrives, confirmed under Fields on the source page.
- A visible sample event under Recent events, with the event type and text you chose.
- A payload shape that you have already proven, so the Datadog webhook sends what Tares expects.
- A primary label that Tares uses to correlate the latency event with your other sources. See AI SRE for how Tares uses those sources during an incident.
- A source you can keep posting to whenever you change the payload or the labels, with no incident needed.
When something else fits
- If your latency alerts already flow through Prometheus and Alertmanager, the Alertmanager connector gives you one event per alert and a ready-made receiver block, with the same post-and-check approach.
- If you want to confirm the Datadog side itself, such as whether a monitor fires the webhook, rely on Datadog’s own webhook documentation and check Recent events in Tares when it calls.