Skip to content

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

  1. Parses the Datadog alert payload
  2. Maps transition to NotificationStatus (resolved / critical / warning / unknown)
  3. Extracts target Slack channel from @webhook-Alerts-to-Slack #channel-name in the body
  4. 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

post(payload)
Source code in apps/eu_tools/webhooks/datadog.py
@webhook_request_handler(
    provider=WebhookRequestProviders.datadog,
    compute_subtype=get_webhook_subtype_from_payload,
)
@datadog_blueprint.arguments(
    NotificationWebhookDatadogPayloadSchema, location="json"
)
@datadog_blueprint.response(status_code=200)
def post(self, payload):  # type: ignore[no-untyped-def]
    handle_datadog_webhook(payload)
    return make_success_json_response()

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",
        )
    ],
)

OpenAPI

Datadog webhook on ReDoc ⧉