Datadog Webhook¶
Route & Auth¶
| Property | Value |
|---|---|
| Method | POST |
| Path | /webhooks/datadog |
| Auth type | basic |
| Header | Authorization |
| Secret | DATADOG_WEBHOOK_CREDENTIALS (JSON: {username, password}) |
| Service account | datadog-webhook@alan-eu-tools.iam.gserviceaccount.com |
| Response | 200 OK |
| Idempotency | @webhook_request_handler with checksum dedup |
Payload¶
| Field | Type | Description |
|---|---|---|
alert.priority |
string |
Alert priority |
alert.query |
string |
Monitor query |
alert.scope |
string |
Alert scope |
alert.title |
string |
Alert title |
alert.transition |
string |
Transition type (Triggered, Recovered, etc.) |
alert.type |
string |
Alert type |
body |
string |
Markdown body (contains @webhook-Alerts-to-Slack #channel-name) |
tags |
string |
Comma-separated tags |
aggregation_key |
string |
Dedup key |
link |
string |
Link to Datadog monitor |
date |
string |
Alert timestamp |
id |
string |
Alert ID |
Behavior¶
- Parses the Datadog alert payload
- Maps
transitiontoNotificationStatus(resolved / critical / warning / unknown) - Extracts target Slack channel from
@webhook-Alerts-to-Slack #channel-namein the body - Sends a structured notification message to the Slack channel thread via
send_notification_message
Integrations¶
- Slack API: notification delivery to extracted channel
Code reference¶
apps.eu_tools.webhooks.datadog.DatadogWebhook ¶
Bases: MethodView
post ¶
Source code in apps/eu_tools/webhooks/datadog.py
apps.eu_tools.webhooks.datadog.datadog_blueprint
module-attribute
¶
datadog_blueprint = CustomBlueprint(
"datadog_webhook",
"datadog_webhook",
url_prefix="/webhooks/datadog",
auth_context_providers=[
WebhookAuthContextProvider(
auth_type=basic,
header_name="Authorization",
secret_name_config_key="DATADOG_WEBHOOK_CREDENTIALS",
auth_principal_type=ServiceAccount,
auth_principal_email="datadog-webhook@alan-eu-tools.iam.gserviceaccount.com",
)
],
)