Skip to main content

Overview

Datadog is a cloud-scale monitoring and security platform. EasyContact integrates with Datadog via webhooks, receiving alerts from monitors and creating incidents automatically.

Setup Instructions

1

Create Integration in EasyContact

  1. Go to ConfigurationIntegrations
  2. Click Add Integration
  3. Select Datadog as the type
  4. Enter a name (e.g., “Production Datadog”)
  5. Save and copy the webhook URL
2

Create Webhook in Datadog

  1. Go to IntegrationsIntegrations
  2. Search for “Webhooks” and click Configure
  3. Click New Webhook
  4. Configure the webhook (see below)
3

Add Webhook to Monitors

  1. Edit your monitor
  2. In Notify your team, add @webhook-easycontact
  3. Save the monitor
4

Test the Integration

Trigger a test alert from a monitor

Webhook Configuration

Basic Setup

FieldValue
Nameeasycontact
URLYour EasyContact webhook URL
PayloadCustom JSON (see below)
Custom HeadersContent-Type: application/json
{
  "alert_id": "$ALERT_ID",
  "alert_title": "$EVENT_TITLE",
  "alert_type": "$ALERT_TYPE",
  "alert_status": "$ALERT_STATUS",
  "alert_transition": "$ALERT_TRANSITION",
  "alert_priority": "$PRIORITY",
  "hostname": "$HOSTNAME",
  "org_id": "$ORG_ID",
  "org_name": "$ORG_NAME",
  "event_msg": "$EVENT_MSG",
  "text_only_msg": "$TEXT_ONLY_MSG",
  "link": "$LINK",
  "snapshot": "$SNAPSHOT",
  "date": "$DATE",
  "last_updated": "$LAST_UPDATED",
  "aggreg_key": "$AGGREG_KEY",
  "tags": "$TAGS",
  "alert_metric": "$ALERT_METRIC",
  "alert_query": "$ALERT_QUERY",
  "alert_scope": "$ALERT_SCOPE"
}

Template Variables

Datadog provides these variables for webhooks:
VariableDescription
$ALERT_IDUnique alert identifier
$EVENT_TITLEAlert title
$ALERT_TYPEType: error, warning, info, success
$ALERT_STATUSCurrent status
$ALERT_TRANSITIONTriggered, Recovered, Re-Triggered, etc.
$PRIORITYP1-P5 priority level
$HOSTNAMEAffected host
$EVENT_MSGFull alert message (HTML)
$TEXT_ONLY_MSGPlain text message
$LINKLink to Datadog alert
$TAGSComma-separated tags
$DATEAlert timestamp
$ORG_IDDatadog organization ID
$ORG_NAMEOrganization name
$AGGREG_KEYAggregation key
$ALERT_METRICMetric that triggered
$ALERT_QUERYMonitor query
$ALERT_SCOPEAlert scope
$SNAPSHOTSnapshot image URL

Field Mapping

Datadog FieldEasyContact Field
alert_idEvent ID
alert_title / event_titleTitle
event_msg / text_only_msgDescription
alert_typeSeverity mapping
alert_status / alert_transitionStatus
hostnameHost
alert_priorityPriority
linkURL
tagsTags (parsed)

Severity Mapping

Alert Type Mapping

Datadog Alert TypeEasyContact Severity
errorCritical
warningWarning
infoInfo
successOK

Priority Mapping

Datadog PriorityEasyContact Severity
P1Critical
P2High
P3Warning
P4Info
P5Info

Custom Mapping

{
  "severityMapping": {
    "sourceField": "alert_priority",
    "mappings": {
      "P1": "critical",
      "P2": "critical",
      "P3": "high",
      "P4": "warning",
      "P5": "info"
    },
    "default": "warning"
  }
}

Status Handling

Datadog TransitionEasyContact Status
TriggeredProblem
Re-TriggeredProblem
RecoveredOK
No DataProblem
No Data RecoveredOK

Example Payload

{
  "alert_id": "12345678",
  "alert_title": "[P1] High CPU on web-server-01",
  "alert_type": "error",
  "alert_status": "Alert",
  "alert_transition": "Triggered",
  "alert_priority": "P1",
  "hostname": "web-server-01",
  "org_id": "123456",
  "org_name": "MyCompany",
  "event_msg": "<p>CPU usage is above 90%</p>",
  "text_only_msg": "CPU usage is above 90%",
  "link": "https://app.datadoghq.com/monitors/12345678",
  "date": "1705315800000",
  "tags": "env:production,team:platform,service:api",
  "alert_metric": "system.cpu.user",
  "alert_query": "avg(last_5m):avg:system.cpu.user{*} > 90"
}

Tags Parsing

Datadog tags in key:value format are automatically parsed:
env:production,team:platform,service:api
Becomes:
  • env: production
  • team: platform
  • service: api
These can be used in escalation routing rules.

Enrichment Examples

{
  "enrichment": {
    "tags.source": "datadog",
    "tags.environment": "production",
    "tags.region": "us-east-1"
  }
}

Monitor Configuration Tips

Adding Webhook to Monitors

In monitor notification settings:
@webhook-easycontact

Including Specific Tags

Use template variables in your monitor message:
{{#is_alert}}
Critical alert on {{host.name}}
{{/is_alert}}

{{#is_recovery}}
Recovered: {{host.name}} is back to normal
{{/is_recovery}}

Troubleshooting

  1. Verify webhook URL in Datadog integrations
  2. Check that @webhook-easycontact is in monitor notification
  3. Test the webhook from Datadog UI
  4. Review Datadog webhook delivery logs
  1. Ensure $HOSTNAME is in your webhook payload
  2. Check that the monitor includes host-level data
  3. For metrics without hosts, hostname may be empty
  1. Verify monitor sends recovery notifications
  2. Check alert_transition includes “Recovered”
  3. Ensure alert_id is consistent between alert and recovery
  1. Include $TAGS in webhook payload
  2. Verify tags are set on the monitor or metric
  3. Check tag format (should be key:value)

Best Practices

Set P1-P5 priority on monitors to ensure proper severity mapping in EasyContact.
Use the recommended payload template to capture all useful information.
Add tags like env, team, and service for better routing and filtering.
Ensure monitors send recovery notifications to automatically resolve incidents.
Set $AGGREG_KEY to help with incident deduplication.