Skip to content

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.

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:

  1. In Datadog, go to Integrations → Webhooks and create two webhooks: opsfusion-alert and opsfusion-recovery, each pointed at https://api.opsfusion.cloud/v1/account/YOUR_ACCOUNT_ID/push/alert with an Authorization: YOUR_API_KEY header.
  2. Leave “Encode as form” unchecked on both — OpsFusion expects raw JSON.
  3. Give each its own Payload (below) — identical except for status.
  4. In any Monitor you want routed to OpsFusion, add this to the notification message:
    {{#is_alert}} @webhook-opsfusion-alert {{/is_alert}}
    {{#is_recovery}} @webhook-opsfusion-recovery {{/is_recovery}}
    This is Datadog’s own documented pattern for state-conditional webhook routing — the conditional tags gate which @webhook-* mention renders into the message, not values inside the payload itself.

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.

OpsFusion fieldDatadog source
teamIdHardcoded per webhook
title$EVENT_TITLE
description$TEXT_ONLY_MSG (Markdown stripped) or $EVENT_MSG
severityHardcoded per webhook; optionally routed via {{#is_priority 'P1'}} in the monitor message if you want per-priority webhooks
statusHardcoded 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
  • 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 Authorization header is set correctly on each webhook, not just the URL.

For integration support: