Skip to content

Instantly share code, notes, and snippets.

@nogweii
Created January 7, 2022 22:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nogweii/6c4c2012dffa6e615233d3d60a9359a3 to your computer and use it in GitHub Desktop.
Save nogweii/6c4c2012dffa6e615233d3d60a9359a3 to your computer and use it in GitHub Desktop.
A webhook payload example for Datadog that includes every single variable in their documentation.

Read more about Datadog's webhook support in their documentation.

In order to create a webhook, you must build a JSON payload to send to the destination URL. Their pre-filled in one only covers a few variables, but is pretty general. But what if you wanted everything? I did, so I made this payload. Hope it can be of use to you, too!

{
"aggregation key": "$AGGREG_KEY",
"alert": {
"cycle key": "$ALERT_CYCLE_KEY",
"id": "$ALERT_ID",
"metric": "$ALERT_METRIC",
"priority": "$ALERT_PRIORITY",
"query": "$ALERT_QUERY",
"scope": "$ALERT_SCOPE",
"status": "$ALERT_STATUS",
"title": "$ALERT_TITLE",
"transition": "$ALERT_TRANSITION",
"type": "$ALERT_TYPE"
},
"date": "$DATE",
"email": "$EMAIL",
"event": {
"message": "$EVENT_MSG",
"title": "$EVENT_TITLE",
"type": "$EVENT_TYPE"
},
"hostname": "$HOSTNAME",
"id": "$ID",
"incident": {
"attachments": "$INCIDENT_ATTACHMENTS",
"commander": "$INCIDENT_COMMANDER",
"customer impact": "$INCIDENT_CUSTOMER_IMPACT",
"fields": "$INCIDENT_FIELDS",
"public id": "$INCIDENT_PUBLIC_ID",
"title": "$INCIDENT_TITLE",
"url": "$INCIDENT_URL",
"message": "$INCIDENT_MSG"
},
"last updated": "$LAST_UPDATED",
"link": "$LINK",
"logs sample": "$LOGS_SAMPLE",
"metric namespace": "$METRIC_NAMESPACE",
"org": {
"id": "$ORG_ID",
"name": "$ORG_NAME"
},
"priority": "$PRIORITY",
"security": {
"rule": {
"group by fields": "$SECURITY_RULE_GROUP_BY_FIELDS",
"id": "$SECURITY_RULE_ID",
"name": "$SECURITY_RULE_NAME",
"query": "$SECURITY_RULE_QUERY",
"type": "$SECURITY_RULE_TYPE"
},
"signal": {
"attributes": "$SECURITY_SIGNAL_ATTRIBUTES",
"id": "$SECURITY_SIGNAL_ID",
"message": "$SECURITY_SIGNAL_MSG",
"severity": "$SECURITY_SIGNAL_SEVERITY",
"title": "$SECURITY_SIGNAL_TITLE"
}
},
"snapshot": "$SNAPSHOT",
"synthetics": {
"first failing step name": "$SYNTHETICS_FIRST_FAILING_STEP_NAME",
"summary": "$SYNTHETICS_SUMMARY",
"test name": "$SYNTHETICS_TEST_NAME"
},
"tags": "$TAGS",
"text only message": "$TEXT_ONLY_MSG",
"user": "$USER",
"username": "$USERNAME"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment