The ServiceNow Datadog integration enables automated incident management by creating ServiceNow incidents from Datadog monitor alerts and providing bidirectional synchronization of incident status. This integration solves the critical business problem of reducing mean time to resolution (MTTR) by automatically escalating infrastructure and application alerts into structured ITSM workflows. DevOps teams, SREs, and IT operations teams use this integration to maintain comprehensive visibility across monitoring and incident management platforms. The integration supports bidirectional data flows where Datadog alerts trigger incident creation in ServiceNow, and ServiceNow incident resolution can automatically resolve corresponding Datadog monitors. The primary automation pattern uses webhook-based triggers for real-time alert processing, with optional scheduled synchronization jobs for status updates, implemented through the ServiceNow Integration Hub Datadog spoke and custom Scripted REST APIs in the Integration Hub module.
Prerequisites
- •ServiceNow Paris release or later with Integration Hub Professional license
- •Datadog account with API and Application Key creation permissions
- •ServiceNow Integration Hub Datadog spoke installed from the ServiceNow Store
- •admin or integration_admin role in ServiceNow for Connection & Credential configuration
- •Datadog webhook notification permissions to configure monitor alert destinations
- •ServiceNow Event Management plugin (com.snc.evt_mgmt) activated if using event-driven incident creation
- •MID Server with outbound internet access if your ServiceNow instance requires it for external API calls
Architecture Overview
The integration utilizes the ServiceNow Integration Hub Datadog spoke, which provides pre-built Actions for creating and updating incidents, metrics retrieval, and monitor management. Authentication is established using Datadog API and Application Keys stored in ServiceNow Connection & Credential Aliases, with the Connection Alias referencing the Datadog API endpoint and the Basic Auth Credential storing the API key as username and Application key as password. Data flows bidirectionally with Datadog webhook notifications triggering inbound Scripted REST APIs to create incidents, while ServiceNow Business Rules trigger outbound Integration Hub flows to update Datadog monitor status. A MID Server is not required for this cloud-to-cloud integration as both platforms support direct HTTPS communication, but may be needed in highly restricted network environments. Rate limiting considerations include Datadog's standard API limits of 300 requests per hour per organization for most endpoints, and ServiceNow's Integration Hub execution limits based on license tier, requiring proper error handling and retry logic in automated flows.
Sourdough: ServiceNow Monitoring and Analytics
A Chrome extension for ServiceNow Admins and Developers with essential tools, analytics, graphs and monitoring features.
Free to install. Pro $5/month after a 14-day no-card trial.
Pro requires the ServiceNow admin role. Upgrade inside the extension.
Implementation Steps
Create Datadog API and Application Keys
Log into your Datadog account and navigate to Organization Settings > API Keys to create a new API key for ServiceNow integration. Copy the generated API key and store it securely as this will be used for authentication. Next, navigate to Organization Settings > Application Keys and create a new application key with a descriptive name like 'ServiceNow Integration'. Copy the application key value as it will only be displayed once. Ensure the user account creating these keys has sufficient permissions for monitor management and incident operations, as the integration will inherit these permissions.
Install and Configure the Datadog Spoke in ServiceNow
Navigate to System Applications > All Available Applications > All and search for 'Datadog' to locate the official ServiceNow Datadog spoke. Install the spoke and activate it through the Integration Hub. Once installed, navigate to Integration Hub > Connections & Credentials > Connection & Credential Aliases and create a new alias named 'Datadog_Connection'. Set the Connection URL to 'https://api.datadoghq.com/api/v1' for US instances or the appropriate regional endpoint. Create a Basic Authentication credential with the Datadog API key as the username and Application key as the password, then associate this credential with your connection alias.
Configure Inbound Webhook API for Datadog Alerts
Navigate to Integration Hub > Scripted REST APIs and create a new API named 'Datadog_Webhook_Handler' with a resource path like '/datadog/alerts'. Create a POST method that will receive Datadog webhook payloads and process them to create incidents. Configure the API to accept JSON payloads and implement authentication using a shared secret or API key validation. Set up proper error handling to return appropriate HTTP status codes to Datadog for retry logic. Test the endpoint using the REST API Explorer to ensure it responds correctly to incoming requests.
(function process(request, response) {
var payload = request.body.data;
var alertTitle = payload.title || 'Datadog Alert';
var alertMessage = payload.body || 'Alert triggered from Datadog';
var incident = new GlideRecord('incident');
incident.initialize();
incident.short_description = alertTitle;
incident.description = alertMessage;
incident.urgency = payload.priority === 'high' ? '1' : '3';
incident.impact = '2';
incident.state = '1'; // New
incident.u_datadog_monitor_id = payload.id;
var incidentSysId = incident.insert();
response.setStatus(200);
response.setHeader('Content-Type', 'application/json');
response.getStreamWriter().writeString(JSON.stringify({status: 'success', incident: incidentSysId}));
})(request, response);Create Integration Hub Flow for Incident to Datadog Sync
Navigate to Integration Hub > Flows and create a new flow named 'Sync_Incident_to_Datadog' triggered by incident record updates. Add a condition to check if the incident state changes to 'Resolved' or 'Closed' and contains a Datadog monitor ID in a custom field. Configure the flow to use the Datadog spoke's 'Resolve Monitor' action, passing the monitor ID from the incident record. Add error handling steps to log failures and optionally send notifications to administrators. Test the flow using the Flow Designer test functionality with sample incident data to ensure proper execution.
// Flow Script Step - Check if Datadog sync is needed
if (fd_data.trigger.current.state == '6' || fd_data.trigger.current.state == '7') {
if (!gs.nil(fd_data.trigger.current.u_datadog_monitor_id)) {
fd_data.datadog_monitor_id = fd_data.trigger.current.u_datadog_monitor_id.toString();
fd_data.sync_required = true;
} else {
fd_data.sync_required = false;
}
} else {
fd_data.sync_required = false;
}Configure Datadog Webhook Notifications
In Datadog, navigate to Integrations > Webhooks and create a new webhook pointing to your ServiceNow Scripted REST API endpoint. Use the full URL including your ServiceNow instance domain and the resource path configured in step 3. Configure the webhook payload to include essential monitor information like monitor ID, alert title, description, priority, and timestamp. Add the webhook notification to your critical monitors by editing each monitor and adding '@webhook-servicenow' to the notification message. Test the webhook using Datadog's webhook test functionality to verify ServiceNow receives and processes the payload correctly.
Set Up Bidirectional Status Synchronization
Create a scheduled job in ServiceNow to periodically sync incident status with Datadog monitors for cases where webhook delivery fails. Navigate to System Definition > Scheduled Jobs and create a job that queries incidents with Datadog monitor IDs and compares their status with Datadog using the Integration Hub spoke. Implement logic to handle status discrepancies and update the appropriate system based on timestamp comparison. Configure the job to run every 15-30 minutes to balance synchronization accuracy with API rate limits. Add comprehensive logging to track sync operations and identify any recurring issues.
// Scheduled Script Execution - Datadog Sync Job
var incident = new GlideRecord('incident');
incident.addNotNullQuery('u_datadog_monitor_id');
incident.addQuery('state', 'IN', '1,2,3'); // Active states
incident.query();
while (incident.next()) {
try {
var hub = new sn_ihub.IntegrationHub();
var response = hub.executeAction('DatadogSpoke', 'Get Monitor Status', {
monitor_id: incident.u_datadog_monitor_id.toString()
});
if (response.haveError()) {
gs.error('Datadog sync failed for incident ' + incident.number + ': ' + response.getErrorMessage());
continue;
}
// Process sync logic based on monitor status
var monitorStatus = response.getBody().status;
// Add your sync logic here
} catch (e) {
gs.error('Exception in Datadog sync: ' + e.message);
}
}Configure Incident Categories and Assignment Rules
Navigate to Incident > Administration > Categories and create specific categories for Datadog-generated incidents to enable proper routing and reporting. Set up Business Rules to automatically assign incidents based on Datadog alert tags or monitor types, using the webhook payload data to determine appropriate assignment groups. Configure Priority and Impact calculation rules based on Datadog alert severity levels and affected services. Create custom fields on the Incident table to store Datadog-specific metadata like monitor ID, alert tags, and original alert timestamp. Ensure these fields are included in relevant incident forms and list views for operational visibility.
// Business Rule - Auto-assign Datadog incidents
if (current.u_source == 'datadog' && current.isNewRecord()) {
var tags = current.u_datadog_tags.toString();
if (tags.indexOf('service:database') > -1) {
current.assignment_group = 'database_team_group_sys_id';
} else if (tags.indexOf('service:web') > -1) {
current.assignment_group = 'web_team_group_sys_id';
} else {
current.assignment_group = 'default_ops_group_sys_id';
}
// Set priority based on Datadog alert level
if (tags.indexOf('alert_type:critical') > -1) {
current.priority = '1';
} else if (tags.indexOf('alert_type:warning') > -1) {
current.priority = '3';
}
}Test End-to-End Integration and Monitoring
Create a test Datadog monitor with a low threshold that will trigger quickly and configure it to send notifications to your ServiceNow webhook. Trigger the monitor alert and verify that an incident is created in ServiceNow with correct categorization and assignment. Resolve the incident in ServiceNow and confirm that the corresponding Datadog monitor is marked as resolved through the Integration Hub flow. Monitor the Integration Hub execution logs and Datadog webhook delivery logs to identify any failures or performance issues. Set up ServiceNow Event Management rules to create alerts for integration failures, such as webhook authentication errors or API quota exceeded scenarios, ensuring operational teams are notified of integration issues.
// Test script to validate Datadog API connectivity
var request = new sn_ws.RESTMessageV2();
request.setEndpoint('https://api.datadoghq.com/api/v1/validate');
request.setHttpMethod('GET');
request.setRequestHeader('DD-API-KEY', 'your_api_key');
request.setRequestHeader('DD-APPLICATION-KEY', 'your_app_key');
var response = request.execute();
gs.info('Datadog API Test - Status: ' + response.getStatusCode());
gs.info('Response: ' + response.getBody());
if (response.getStatusCode() == 200) {
gs.info('Datadog API connection successful');
} else {
gs.error('Datadog API connection failed: ' + response.getErrorMessage());
}Common Use Cases
Infrastructure Alert to Critical Incident Escalation
High-priority Datadog infrastructure monitors detecting server outages, memory exhaustion, or network connectivity issues automatically create Priority 1 incidents in ServiceNow. The integration maps Datadog alert severity levels to ServiceNow priority and impact values, ensuring critical infrastructure issues receive immediate attention. Assignment rules route incidents to appropriate technical teams based on Datadog monitor tags, while escalation policies ensure timely response. This use case significantly reduces detection-to-response time for infrastructure failures.
Application Performance Incident Management
Datadog APM alerts for application errors, high response times, or throughput degradation trigger incident creation with contextual information including affected services and error rates. The integration preserves Datadog's rich alert context including stack traces and performance metrics within ServiceNow incident descriptions. Incidents are automatically categorized as software issues and assigned to development teams based on service ownership tags. Resolution in ServiceNow triggers automatic acknowledgment of corresponding Datadog monitors, maintaining consistent status across platforms.
Security Alert Investigation Workflow
Datadog Security Monitoring alerts for suspicious activities, failed authentication attempts, or potential intrusions create security incidents in ServiceNow with appropriate classification and urgency. The integration maps security alert types to ServiceNow's security incident categories and automatically assigns them to the security operations team. Incident workflows include required security investigation steps and compliance reporting requirements. Bidirectional sync ensures that security acknowledgment and resolution status remains consistent between monitoring and incident management systems.
Business Service Impact Correlation
Datadog composite monitor alerts affecting business services create incidents that automatically link to ServiceNow's Business Service Management records, providing impact assessment and stakeholder notification. The integration correlates Datadog service tags with ServiceNow CMDB business services to determine affected business functions and customer impact. Major incident procedures are automatically triggered for business-critical service disruptions, initiating communication workflows and executive notifications. Resolution tracking provides metrics for business service availability and MTTR reporting.
DevOps Pipeline Failure Management
Datadog alerts monitoring CI/CD pipeline health, deployment failures, or post-deployment issues create change-related incidents in ServiceNow that link to corresponding change requests. The integration correlates deployment events with infrastructure and application health metrics to provide comprehensive incident context. Failed deployments automatically trigger rollback procedures through ServiceNow workflows while creating visibility for development and operations teams. Successful incident resolution closes associated Datadog monitors and updates change request records with resolution details.
Troubleshooting
HTTP 401 Unauthorized errors when ServiceNow calls Datadog API
Verify the API and Application keys are correctly configured in the ServiceNow Connection & Credential Alias by testing them directly in Datadog's API documentation page. Check that the credential record uses the API key as username and Application key as password, not the reverse. Navigate to Integration Hub > Connections & Credentials and test the connection using the built-in test functionality. If keys are correct but errors persist, verify the Datadog user account has sufficient permissions for the specific API endpoints being called.
Datadog webhooks timing out or failing to reach ServiceNow
Check ServiceNow's inbound webhook endpoint accessibility by testing it from an external tool like Postman or curl with a sample payload. Verify the Scripted REST API is active and properly configured by checking System Web Services > Scripted REST APIs and ensuring the resource is enabled. Review ServiceNow system logs for any processing errors or exceptions in the webhook handler code. If using a ServiceNow developer instance, note that webhooks may fail due to instance hibernation, requiring a Personal Developer Instance (PDI) or higher environment for reliable webhook delivery.
Integration Hub flows failing with 'Connection not found' errors
Verify the Connection & Credential Alias name exactly matches what's referenced in the Integration Hub flow by navigating to the flow designer and checking the connection reference. Ensure the Datadog spoke is properly installed and activated by checking System Applications > All Applications and confirming the Datadog spoke status. Test the connection credentials by creating a simple test flow that calls a basic Datadog API endpoint like the validation endpoint. Check that the connection alias is shared with the appropriate scope if the flow is running in a scoped application.
Incidents created but missing critical Datadog alert information
Examine the webhook payload structure by adding logging statements to the Scripted REST API handler to capture and inspect the complete JSON payload from Datadog. Compare the payload structure with your parsing logic to identify missing or incorrectly mapped fields, particularly for nested JSON objects like alert tags or metric values. Update the incident creation script to handle optional fields gracefully and provide default values for missing data. Test with different types of Datadog alerts to ensure your parsing logic handles variations in payload structure across monitor types.
Bidirectional sync causing infinite loops or duplicate updates
Implement proper change detection logic by comparing timestamps and adding sync flags to prevent recursive updates between ServiceNow and Datadog. Add a custom field to incident records to track the last sync timestamp and source system of the most recent update. Modify Business Rules and Integration Hub flows to check this field before triggering sync operations, ensuring updates originating from Datadog don't immediately trigger a reverse sync. Use Integration Hub's built-in duplicate prevention features and implement proper error handling to avoid retry storms during API failures.
Rate limiting errors from Datadog API causing sync failures
Implement exponential backoff retry logic in your Integration Hub flows and scheduled jobs to handle rate limiting gracefully by checking HTTP 429 response codes. Reduce the frequency of scheduled sync jobs and implement batching for bulk operations where possible to stay within Datadog's API limits of 300 requests per hour. Add proper error handling to queue failed requests for retry during the next sync cycle rather than failing completely. Monitor Integration Hub execution logs to identify peak usage periods and adjust sync schedules to distribute API calls more evenly throughout the day.
Pro Tips
- →Implement custom incident correlation logic using Datadog alert tags to automatically link related incidents and prevent alert storms from creating duplicate tickets. Use ServiceNow's Event Management correlation rules combined with Datadog service and environment tags to group related alerts into single incidents, significantly reducing noise during widespread outages.
- →Create dashboard widgets in ServiceNow to display real-time Datadog metrics within incident forms using the Integration Hub spoke's metrics retrieval actions. This provides incident responders with immediate visibility into current system state without switching between platforms, improving resolution efficiency and context awareness.
- →Set up proactive incident prevention by configuring ServiceNow Predictive Intelligence to analyze patterns in Datadog-generated incidents and identify leading indicators of major outages. Use this data to create preventive change requests and maintenance windows before issues escalate to customer impact.
- →Leverage ServiceNow's Flow Designer variables and conditional logic to implement intelligent alert suppression during scheduled maintenance windows by cross-referencing Datadog alerts with ServiceNow change calendar records. This prevents unnecessary incident creation during planned downtime while maintaining visibility of unexpected issues.
- →Implement advanced error handling in your Integration Hub flows using Try-Catch actions and create custom alert notifications for integration failures, ensuring operations teams are immediately aware of monitoring blind spots when the Datadog-ServiceNow integration experiences issues.
- →Use ServiceNow's Performance Analytics to create comprehensive reporting dashboards combining Datadog alert volumes with ServiceNow incident metrics, providing leadership visibility into infrastructure health trends, MTTR improvements, and the business impact of monitoring investments.
Known Limitations
- —Datadog API rate limiting restricts most endpoints to 300 requests per hour per organization, which can impact real-time synchronization for high-volume alert environments requiring careful batch processing and sync scheduling. The Integration Hub Professional license includes execution limits that may constrain complex flows during peak alert periods, necessitating flow optimization and error handling strategies.
- —The ServiceNow Integration Hub Datadog spoke does not support all Datadog API endpoints, particularly newer features like Security Monitoring APIs or advanced Dashboard API operations, requiring custom REST Message records for unsupported functionality. Complex Datadog alert payloads with nested metric data may require custom parsing logic beyond the spoke's standard actions.
- —Webhook delivery reliability depends on network connectivity and ServiceNow instance availability, with no built-in queuing mechanism for failed deliveries during ServiceNow maintenance windows or outages. Personal Developer Instances (PDIs) may hibernate, breaking webhook delivery and requiring higher-tier ServiceNow environments for production integrations.
- —Real-time bidirectional synchronization can introduce latency during high-alert volumes, and the integration lacks native support for Datadog's advanced features like composite monitors, SLO alerts, or forecast monitoring without additional custom development. Large Datadog organizations with thousands of monitors may experience performance impacts when implementing comprehensive sync operations.
- —ServiceNow's Connection & Credential management requires manual API key rotation and lacks automatic key refresh capabilities, creating potential security and operational overhead for organizations with strict key rotation policies. The integration also cannot preserve all Datadog alert metadata, particularly complex metric query contexts and alert evaluation history, within standard ServiceNow incident fields.
Frequently Asked Questions
Does the Datadog integration require a MID Server for cloud-to-cloud communication?
No, the Datadog integration typically does not require a MID Server since both ServiceNow and Datadog are cloud services capable of direct HTTPS communication. The Integration Hub Datadog spoke makes outbound API calls directly from your ServiceNow instance to Datadog's public API endpoints. However, organizations with highly restrictive network policies that block outbound connections from ServiceNow may need a MID Server to proxy API calls through their approved network pathways.
Can I customize which Datadog alerts create incidents versus which ones only create events?
Yes, you can implement sophisticated filtering logic in your Scripted REST API webhook handler to route different types of Datadog alerts to incidents, events, or even discard them entirely. Use conditional logic based on alert priority, monitor tags, affected services, or custom alert metadata to determine the appropriate ServiceNow record type. For example, critical infrastructure alerts can create incidents while informational alerts create events, and you can leverage ServiceNow's Event Management correlation rules to promote events to incidents based on volume or pattern thresholds.
How do I handle Datadog monitor acknowledgment when incidents are assigned but not resolved?
Create additional Integration Hub flows triggered by incident assignment or state changes to send acknowledgment updates to Datadog using the spoke's monitor management actions. You can map ServiceNow incident states like 'In Progress' or 'On Hold' to Datadog monitor acknowledgment status, providing visibility to Datadog users that the alert is being actively worked. This requires configuring Business Rules to trigger flows on assignment group changes and implementing logic to track acknowledgment status separately from resolution.
What happens if the Integration Hub Datadog spoke doesn't support a specific API endpoint I need?
You can supplement the spoke with custom REST Message records or Scripted REST API calls for unsupported endpoints while still leveraging the spoke for standard operations. Create REST Message records under System Web Services > Outbound > REST Message for custom Datadog API calls, using the same Connection & Credential Alias configured for the spoke to maintain consistent authentication. This hybrid approach allows you to access newer Datadog features like Security Monitoring or advanced Dashboard APIs while benefiting from the spoke's pre-built actions for common operations.
How can I prevent duplicate incidents when Datadog sends multiple alerts for the same issue?
Implement deduplication logic in your webhook handler by checking for existing open incidents with the same Datadog monitor ID or alert signature before creating new records. Use ServiceNow's Event Management correlation capabilities to group related alerts based on CI, service, or custom correlation keys derived from Datadog alert tags. You can also implement time-based windows where subsequent alerts for the same monitor within a specified timeframe update existing incidents rather than creating new ones, combined with alert volume tracking to escalate priority when multiple related alerts occur.
Is it possible to sync ServiceNow incident comments and work notes back to Datadog?
Yes, you can create Integration Hub flows triggered by journal entry creation on incident records to post updates back to Datadog using their Events API or Comments API if available for your monitor type. Configure the flows to filter for specific comment types or use comment prefixes to control which updates sync back to Datadog, preventing information overload. This bidirectional communication helps maintain context for teams who primarily work in Datadog while incident management occurs in ServiceNow, though you should consider data sensitivity and implement appropriate filtering for confidential information.
What are the best practices for handling Datadog API authentication key rotation?
Implement a key rotation process that updates both the Datadog API keys and ServiceNow Connection & Credential Alias simultaneously during maintenance windows to minimize service disruption. Create monitoring alerts in ServiceNow to detect authentication failures and automatically notify administrators when key rotation is needed, using scheduled jobs that test API connectivity and alert on 401 errors. Consider creating duplicate credential records with new keys that can be quickly swapped in the Connection Alias configuration, and always test the integration thoroughly in a sub-production environment before updating production credentials to ensure uninterrupted alert processing.
Test Your Knowledge
Quick 3-question quiz — see how your ServiceNow skills stack up.
A list view on a table with millions of records is slow. Best fix?
Select an answer to continue