Datadog
Datadog Monitors can notify OpsFusion through its Webhooks integration, which supports a fully customizable JSON payload using Datadog’s own template variables.
See API Overview for authentication and finding your Account ID/Team ID.
Configure the Webhook in Datadog
Section titled “Configure the Webhook in Datadog”Datadog’s Payload field only does flat variable substitution — it doesn’t support conditional logic inline in the JSON body. Datadog’s {{#is_alert}}/{{#is_recovery}} conditionals are real, but they only work in a monitor’s notification message, where they’re used to select which named webhook fires — not to branch logic inside one webhook’s payload. So dynamic status means two webhooks, one per state, routed to conditionally from the monitor message:
- In Datadog, go to Integrations → Webhooks and create two webhooks:
opsfusion-alertandopsfusion-recovery, each pointed athttps://api.opsfusion.cloud/v1/account/YOUR_ACCOUNT_ID/push/alertwith anAuthorization: YOUR_API_KEYheader. - Leave “Encode as form” unchecked on both — OpsFusion expects raw JSON.
- Give each its own Payload (below) — identical except for
status. - In any Monitor you want routed to OpsFusion, add this to the notification message:
This is Datadog’s own documented pattern for state-conditional webhook routing — the conditional tags gate which{{#is_alert}} @webhook-opsfusion-alert {{/is_alert}}{{#is_recovery}} @webhook-opsfusion-recovery {{/is_recovery}}
@webhook-*mention renders into the message, not values inside the payload itself.
Payload Template
Section titled “Payload Template”opsfusion-alert webhook:
{ "teamId": YOUR_TEAM_ID, "title": "$EVENT_TITLE", "description": "$TEXT_ONLY_MSG", "severity": 2, "status": 1, "labels": { "monitor_id": "$ALERT_ID" }}opsfusion-recovery webhook: identical, with "status": 3.
Datadog doesn’t expose a variable that maps directly to OpsFusion’s numeric severity either — $ALERT_PRIORITY returns Datadog’s own P1-P5 scale, so map it once and hardcode severity per webhook the same way as status, rather than trying to compute it inline. If you need severity-specific routing too, {{#is_priority 'P1'}}...{{/is_priority}} in the monitor message works the same way as is_alert/is_recovery — gating which webhook mention renders, not branching inside the payload.
Field Mapping
Section titled “Field Mapping”| OpsFusion field | Datadog source |
|---|---|
teamId | Hardcoded per webhook |
title | $EVENT_TITLE |
description | $TEXT_ONLY_MSG (Markdown stripped) or $EVENT_MSG |
severity | Hardcoded per webhook; optionally routed via {{#is_priority 'P1'}} in the monitor message if you want per-priority webhooks |
status | Hardcoded per webhook (1 for opsfusion-alert, 3 for opsfusion-recovery), routed via {{#is_alert}}/{{#is_recovery}} in the monitor message |
labels | $ALERT_ID, $SNAPSHOT, or custom tags |
Troubleshooting
Section titled “Troubleshooting”- Payload not received: confirm the monitor’s notification message actually includes the conditional
@webhook-*mentions shown above — Datadog webhooks only fire when explicitly mentioned in the notify message, not automatically for all monitors. - Both webhooks fire, or neither does: double check the
{{#is_alert}}/{{#is_recovery}}tags are spelled and closed correctly ({{/is_alert}},{{/is_recovery}}) — a typo here silently breaks the conditional and Datadog treats the mention as literal text or drops it. - 403 from OpsFusion: verify the custom
Authorizationheader is set correctly on each webhook, not just the URL.
Support
Section titled “Support”For integration support:
- Email: support@opsfusion.cloud
- See Send Alerts for the full API reference