Datadog webhook
After creating a webhook automation with the Datadog preset, keep the Pulumi setup panel open.
Configure Datadog
In Datadog, open Integrations and select Webhooks. On the Configuration tab, select New under Webhooks and enter a name.
Paste the Pulumi webhook URL into URL.
Replace Payload with the template below, also available through Copy payload in the Pulumi setup panel. It extends Datadog’s default payload with monitor fields that identify the alert.
{ "body": "$EVENT_MSG", "last_updated": "$LAST_UPDATED", "event_type": "$EVENT_TYPE", "title": "$EVENT_TITLE", "date": "$DATE", "org": {"id": "$ORG_ID", "name": "$ORG_NAME"}, "id": "$ID", "alert_id": "$ALERT_ID", "alert_transition": "$ALERT_TRANSITION", "alert_priority": "$ALERT_PRIORITY", "alert_query": "$ALERT_QUERY", "alert_scope": "$ALERT_SCOPE", "hostname": "$HOSTNAME", "tags": "$TAGS", "link": "$LINK" }Under Custom Headers, paste the JSON from the setup panel:
{"X-Pulumi-Trigger-Secret":"<pulumi-secret>"}. Replace<pulumi-secret>with the displayed Pulumi secret.Select Save in Datadog.
Add
@webhook-<name>to the notification message of each monitor that should invoke the agent, replacing<name>with the webhook’s name.Return to Pulumi and select Done.
Test the connection
Test a Datadog monitor whose notification message includes @webhook-<name>, replacing <name> with the webhook’s name.
Follow Test a webhook to check delivery and task results. Test deliveries can run the agent.