v2026.1 Open Portal ↗
On this page

Datadog Integration

Prerequisites

RequirementDetails
Datadog accountAdmin role to create API/App keys and configure webhooks
Datadog planPro or Enterprise (Webhooks integration required)
StackFlow rolesuper_admin

Step 1: Generate API and App Keys

  1. In Datadog, go to Organization Settings → API Keys → New Key
  2. Name it StackFlow and copy the API Key
  3. Go to Organization Settings → Application Keys → New Key
  4. Name it StackFlow App Key and copy the Application Key
Key Scopes: Datadog Application Keys inherit the permissions of the user who creates them. Create a dedicated service account with read-only access for monitoring and incident query operations. The webhook delivery uses the API key only.

Step 2: Configure Monitor Webhook

  1. In Datadog, go to Integrations → Webhooks → New
  2. Set the URL to: https://your-instance.stackflow-tech.com/prod/api/webhooks/inbound/datadog
  3. Enable Use custom payload and paste the StackFlow payload template:
{
  "alert_title": "$ALERT_TITLE",
  "alert_type": "$ALERT_TYPE",
  "alert_transition": "$ALERT_TRANSITION",
  "priority": "$PRIORITY",
  "hostname": "$HOSTNAME",
  "tags": "$TAGS",
  "url": "$LINK",
  "monitor_id": "$ALERT_ID",
  "timestamp": "$TIMESTAMP"
}
  1. In the Custom Headers section, add: X-StackFlow-Secret: YOUR_WEBHOOK_SECRET
  2. Click Save

Step 3: Tag Mapping

Configure how Datadog tags map to StackFlow fields. Tags follow the format key:value:

Datadog TagStackFlow FieldExample
env:productionEnvironment filterOnly alert on production monitors
team:platformassignment_groupRoutes to Platform Engineering
service:apicategorySets incident category to api
severity:criticalpriorityMaps to P1
ci:CI0000789ci_idLinks CI in CMDB

Step 4: Connect in StackFlow

  1. Navigate to Admin → Integration Hub → Datadog → Configure
  2. Enter the Datadog API Key and Application Key
  3. Enter your Datadog site (e.g., datadoghq.com or datadoghq.eu)
  4. Configure tag-to-field mapping
  5. Set priority mapping: ALERT→P1, WARNING→P2, NO DATA→P3, INFO→P4
  6. Click Save & Test

Monitor to Incident Auto-Creation

When a Datadog monitor fires, StackFlow evaluates configured rules and automatically creates an incident. Deduplication ensures only one incident is created per monitor until it resolves:

# View auto-created incidents from Datadog
curl -H "Authorization: Bearer $TOKEN"   "https://your-instance.stackflow-tech.com/prod/api/incidents?source=datadog&state=new"
Alert Deduplication: StackFlow uses the Datadog monitor_id as a dedup key. If a monitor fires again before the existing incident is resolved, a work note is added to the existing incident rather than creating a duplicate.

Alert Routing Rules

{
  "routing_rules": [
    {
      "condition": "tags.env == 'production' AND alert_type == 'metric alert'",
      "action": "create_incident",
      "assignment_group": "Platform Engineering",
      "priority_override": null
    },
    {
      "condition": "tags.service == 'payments'",
      "action": "create_incident",
      "assignment_group": "Payments SRE",
      "priority_override": "P1",
      "notify_slack_channel": "#incidents-payments"
    },
    {
      "condition": "tags.env != 'production'",
      "action": "ignore"
    }
  ]
}

Field Reference

FieldRequiredDescription
API KeyYesDatadog API key for inbound event authentication
App KeyYesDatadog Application key for query operations
Datadog SiteYesdatadoghq.com, datadoghq.eu, us3.datadoghq.com
Webhook SecretYesSecret for inbound webhook signature verification
Priority MappingNoMap Datadog alert levels to StackFlow priorities
Tag MappingNoMap Datadog tags to StackFlow incident fields
Auto-ResolveNoResolve SF incident when Datadog monitor recovers (default: true)

Testing the Integration

  1. In Datadog, trigger a test webhook: Integrations → Webhooks → [your webhook] → Test
  2. Verify the StackFlow incident was created in ITSM → Incidents
  3. Resolve the Datadog monitor and verify the StackFlow incident moves to resolved
# Manually send a test Datadog-format payload
curl -X POST   https://your-instance.stackflow-tech.com/prod/api/webhooks/inbound/datadog   -H "Content-Type: application/json"   -H "X-StackFlow-Secret: YOUR_SECRET"   -d '{"alert_title":"Test Monitor","alert_type":"metric alert","alert_transition":"Triggered","priority":"P2","hostname":"test-host","tags":"env:production,team:platform"}'

Troubleshooting

IssueCauseFix
Incidents not createdRouting rule filtering out alertsCheck routing rules in Integration Hub; test with action: create_incident rule without conditions
Wrong priorityPriority mapping misconfiguredReview priority mapping; verify Datadog $PRIORITY variable in payload
Duplicate incidentsDedup not matchingVerify monitor_id field is present in the webhook payload template
API key 403 errorsApp key permissionsEnsure App Key user has incidents_read and monitors_read permissions