How do I test Datadog monitors about failed deploys before a real incident?
Tares lets you test a Datadog failed-deploy monitor by posting a sample payload to the source’s ingest URL, then reading Recent events and Fields on the source page. Datadog reaches Tares through the webhook connector and a vendor setup, so you check the label mapping before any real deploy fails. The check takes one curl command and one look at the source page.
How it works
Tares has no connector of its own for Datadog today. A Datadog webhook posts JSON to a webhook source in Tares. Tares stores the payload lossless and uses the labels you declare to map payload fields into the event.
The shape of the payload is yours. You write it in the Datadog webhook Payload field from Datadog variables, so you decide which fields a failed-deploy monitor sends.
Three details matter when you test:
- Keep the payload flat.
event_type_fieldandtext_templateread top-level fields only. - Declare one label per field you want to correlate on, and mark one as
primary. - On a secured instance, the sender uses an
AuthorizationBearer header holding an ingest-scoped API key. You only need it when Tares has auth on.
For a push source, test_source takes no payload and only returns the ingest endpoint, so it does not check your label mapping. To check the mapping, post a sample payload to the ingest URL and read Recent events and Fields on the source page.
Set it up
- Create a webhook source for your Datadog failed-deploy monitor. Declare a label for each payload field you want, with one primary. You can also ask a connected agent to create the source and give you the ingest URL. The agent returns the ingest endpoint, and you can copy it from the source page too.
- name: ci-events
connector: webhook
config:
event_type_field: action
text_template: '{action} by {sender}'
labels:
- { name: pipeline, field: pipeline, primary: true }- Post a sample payload shaped like the one your monitor will send. Use the same top-level 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 and read Recent events. Confirm the event type comes from
action, the text matches yourtext_template, and the primary label carries the value you expect. -
Read Fields. It shows which payload fields arrive and how often, so you can see whether the label you chose is reliable. Adjust the labels, post the sample again, and recheck until the event looks right.
-
When the mapping is right, set up Datadog. Open the Webhooks integration and add a webhook whose URL is the Tares ingest URL.
-
Write the payload as flat JSON from Datadog variables. When Tares has auth on, add custom headers as JSON with an
AuthorizationBearer header holding an ingest-scoped API key. Creating a push source in the console mints one for it and shows it once. -
Put the webhook handle in the monitor message, in the form
@webhook-followed by your webhook name, so the monitor calls it. Trigger the monitor once from Datadog if you want to see a real delivery land in Recent events as well.
The same flow works for any sender that can post JSON. The Alertmanager connector uses the same check, a test batch posted to its ingest endpoint and then Recent events. It fits when your alerts come through Alertmanager instead.
What you get
- Confidence in the mapping before an incident. You see the event type, text and labels Tares produces from your payload while nothing is failing.
- A clear view of which fields arrive. Fields shows what your payload carries, so you can promote the right one to the primary label.
- A payload shape you control. Because you write the Datadog payload, you can change it and retest with the same curl command.
- A failed-deploy event that sits with your other sources. Once the mapping is right, it correlates with them. See AI SRE for how Tares works with those events.
- A short feedback loop. Post, read Recent events, edit the labels, and repeat, with no deploy needed.
When something else fits
- If your failed deploys already reach Tares from your CI system, point that system at a webhook source directly. You do not need Datadog in the path.
- If Datadog is only a relay for alerts that Alertmanager already routes, use the Alertmanager connector, which makes one event per alert.
- If your monitor needs a nested payload, flatten it in the Datadog Payload field first, because the event type and text template read top-level fields only.