Datadog Integration Guide
Send monitor alerts through webhooks.
Configure Datadog monitors to send webhook notifications to Harness AI SRE when alerts trigger.
Before you begin
Harness webhook endpoint: Create a Datadog webhook in Harness AI SRE using the Datadog webhook template.
Datadog permissions: Access to create or modify monitors and integrations in Datadog.
Webhook URL: Copy the webhook URL from your Harness webhook configuration.
Datadog webhook documentation: Go to Datadog Webhooks Integration to understand Datadog's webhook capabilities.
Monitor notification syntax: Go to Datadog Monitor Notifications to learn about notification configuration and template variables.
Create webhook integration in Datadog
Navigate to Datadog integrations
Open the Webhooks integration to add a new webhook:
In Datadog, navigate to Integrations, then select Integrations
Search for and select Webhooks
Go to the Configuration tab
Click New
Configure the webhook
Configure these fields:
Name:
harness-ai-sre(or any descriptive name)URL: Your Harness webhook URL
Encode as form: Leave unchecked (use JSON)
Custom Headers: Add if your Harness webhook requires authentication
Configure the payload
Use the Payload field to map Datadog variables to JSON:
Save the webhook
Click Save to create the webhook integration.
Configure field mapping in Harness
In your Harness webhook configuration, map the Datadog payload fields to alert properties.
Basic field mapping example
Use Mustache templates for simple field mapping:
Advanced field mapping with CEL
Use CEL expressions for conditional logic and transformations:
Add webhook to Datadog monitors
Option 1: Add to existing monitor
Add the webhook notification to a monitor you already have:
Open the Datadog monitor you want to integrate
Scroll to the Notify your team section
Add the webhook using the
@webhook-syntax:
Click Save
Option 2: Add to monitor template
For monitors created from templates:
Option 3: Use notification policies
Configure Datadog notification policies to automatically add the webhook to matching monitors.
Test the integration
Test from Datadog
Send a test notification from a configured monitor:
Open a monitor configured with the webhook
Click Test Notifications
Select a test scenario (Alert, Warning, Recovery)
Click Run Test
Datadog sends a test webhook to Harness.
Verify in Harness
Confirm the test alert arrived and mapped correctly:
Navigate to Alerts in Harness AI SRE
Check that the test alert appears
Verify field mapping:
Alert title matches expected format
Severity is correct
Tags are populated
Link works
Available Datadog variables
Datadog provides these template variables for webhook payloads:
$EVENT_TITLE
Monitor name and status
[Alert] High CPU on prod-server-01
$TEXT_ONLY_MSG
Plain text message
CPU usage above 90% for 5 minutes
$ALERT_STATUS
Current status
ALERT, WARNING, RECOVERED, NO DATA
$PRIORITY
Alert priority
P1, P2, P3, P4, P5
$ALERT_METRIC
Primary metric name
system.cpu.user
$ALERT_QUERY
Monitor query
avg(last_5m):avg:system.cpu.user{*} > 0.9
$SERVICE
Service tag value
api-gateway
$ENV
Environment tag value
production
$HOSTNAME
Affected host
prod-server-01
$ALERT_ID
Unique alert identifier
123456789
$ALERT_CYCLE_KEY
Alert cycle identifier
abc123def456
$LINK
Link to alert in Datadog
https://app.datadoghq.com/...
$SNAPSHOT
Graph snapshot URL
https://p.datadoghq.com/...
$LAST_UPDATED
Timestamp of last update
2025-07-01 10:15:30 UTC
$TAGS
All monitor tags
service:api,env:prod
$ORG_ID
Datadog organization ID
12345
$ORG_NAME
Organization name
My Company
The current metric value and alert threshold are not exposed as webhook payload variables. Access them with the {{value}} and {{threshold}} Mustache variables in the monitor message body instead, then include the rendered message in the webhook payload through $TEXT_ONLY_MSG.
Advanced configuration
Filter by alert status
Send different payloads for alerts vs recoveries:
Route by priority
Create separate Harness webhooks for different priorities:
Include metric values and thresholds
The webhook payload does not carry the metric value or threshold directly. Datadog exposes those only as {{value}} and {{threshold}} template variables in the monitor message body, so include them there and pass the rendered message through to the webhook:
Monitor message body:
Harness CEL mapping:
Troubleshooting
Example: complete integration
This example shows a production-ready Datadog-to-Harness integration for a microservices platform.
Datadog webhook payload
Harness webhook field mapping example
Datadog monitor notification
Next steps
Route alerts: Route and deduplicate Datadog alerts.
Use CEL in webhooks: Add advanced filtering logic.
AI agent: Enable automated alert investigation.
Related documentation
Datadog official documentation
Webhooks integration: Complete guide to Datadog webhook integration setup and configuration.
Monitor notifications: Monitor notification configuration and
@webhooksyntax.Template variables reference: Complete list of available template variables (
$EVENT_TITLE,$PRIORITY,$SERVICE, and others).Webhook template variables: Webhook-specific variables and payload customization.
Last updated
Was this helpful?