# Integrate Spike with Datadog

<figure><img src="https://1743514643-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Ln3jS1bJTTsE3yoEcOu%2Fuploads%2Fgit-blob-d912dc4374e2098acf98c4f58b913cebb1ca2eec%2Fdatadog-integration.png?alt=media" alt="Datadog integration with Spike"><figcaption></figcaption></figure>

## Service and Integration Setup

Before proceeding, ensure you have:

1. Added the **Datadog integration** in Spike.
2. Copied the **Spike webhook URL** from the dashboard.

For details, see:

{% content-ref url="create-integration-and-service-on-dashboard" %}
[create-integration-and-service-on-dashboard](https://docs.spike.sh/integrations-guideline/create-integration-and-service-on-dashboard)
{% endcontent-ref %}

***

## Configure the Webhook in Datadog

### Step 1: Open Integrations

From the **sidebar**, select **Integrations**.

![Select Integration](https://1743514643-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Ln3jS1bJTTsE3yoEcOu%2Fuploads%2Fgit-blob-ba4a235fc0eae04164d070ab49c12bd558aaff27%2Fimage.png?alt=media\&token=f294b707-afd5-4d9f-a54f-408b22db8ae5)

***

### Step 2: Choose Webhooks

Search for **Webhooks** in the integrations list and select it.

![Select Webhook](https://1743514643-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Ln3jS1bJTTsE3yoEcOu%2Fuploads%2Fgit-blob-47dc375af2e0438741299df27bc498f7f27d061e%2Fdatadog_search_webhook.png?alt=media)

***

### Step 3: Create a Webhook

Fill in the details and paste your **Spike webhook URL** into the **URL field**.

![Datadog Webhook](https://1743514643-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Ln3jS1bJTTsE3yoEcOu%2Fuploads%2Fgit-blob-e752cfa388d6dd1552fee5494eba57f50eb47ed4%2Fdatadog_new_webhook.png?alt=media)

***

### Step 4: Add the Payload

Copy the following payload and paste it into Datadog. You can also customize it with any of Datadog’s template variables.

{% hint style="warning" %}
To ensure proper incident management:

1. Include **`$AGGREG_KEY`** – enables automatic resolution.
2. Include **`$ALERT_TRANSITION`** – indicates if the event is triggering or resolving.
   {% endhint %}

```json
{ 
  "body": "$EVENT_MSG",
  "last_updated": "$LAST_UPDATED",
  "event_type": "$EVENT_TYPE",
  "title": "$EVENT_TITLE",
  "date": "$DATE",
  "alert_transition": "$ALERT_TRANSITION",
  "aggreg_key": "$AGGREG_KEY", 
  "org": {
    "id": "$ORG_ID",
    "name": "$ORG_NAME"
  },
  "id": "$ID" 
}
```

***

## Set Up Automatic Notifications

1. Go to **Incident Settings** in Datadog.
2. Click **Notification Rules** → **New Rule**.
3. Select condition:
   * `Declared or Incident attributes are updated`.
4. Configure the conditions as required.
5. In the **Notify** field, select the **webhook you created**.
6. For auto-resolution, enable **Renotify on: Status Update**.

![Datadog Notification Rules](https://1743514643-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Ln3jS1bJTTsE3yoEcOu%2Fuploads%2Fgit-blob-914149f942c282850ef7de2c48b85394ba3fdfb5%2Fdatadog_notification_rules.png?alt=media)

***

At Spike, we’re committed to integrating with the tools your team already uses. Our mission is to help you detect incidents, crashes, and spikes before your customers do.

If you’d like us to build a new integration, contact us at [**support@spike.sh**](mailto:support@spike.sh).
