# Datadog

To automate the reporting and closing of incidents on your status page based on the status reported by Datadog synthetic checks, follow these steps.

### Create your Webhook Integration in StatusPal

First, you need to create an <mark style="color:purple;">endpoint URL</mark> within StatusPal. This URL will act as the bridge between Datadog and StatusPal, receiving notifications from Datadog about uptime check results via webhook.

* **Navigate to Services:** On your Status Page, create a new service or edit an existing service.
* **Add Webhook:** On *Monitoring and incident automation section*, check on `Webhook` and select `Datadog`.
* **Finish and Save:** Create or update the service, then copy the <mark style="color:purple;">endpoint URL</mark> that will be created for you.

<figure><img src="https://4061983002-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgIMm5p2V7PNx3dS7vwKE%2Fuploads%2FURVkkpHZ7Cgk9PRbqLPK%2Fdatadog-confi-statuspal.png?alt=media&#x26;token=a96e0063-5108-43c5-ad2c-f0b81b7d8b1a" alt=""><figcaption></figcaption></figure>

### Create your Webhook Integration in Datadog

Next, you need to create a webhook integration.&#x20;

* **Navigate to Integrations:** On the Datadog navigation bar, click on `Integrations`.
* **Add a Webhook:** Search for Webhook integration and click on it.
* **Configure Webhook:** On the W*ebhooks* section, click on `+ New`. You'll need to add the <mark style="color:purple;">endpoint URL</mark> provided by StatusPal. *This URL is specific to your StatusPal service configuration and is essential for the integration to work correctly*. Paste this URL into the appropriate field.
* **Payload Configuration:** On the notification message, you can configure the payload that will be send to StatusPal. You'll need to add one more property to the default template. If you need to configure it because you will use this weebhook somewhere else, you must keep the property we requiere on the json object: `"alert_type": "$ALERT_TYPE",`

```
{
    "alert_type": "$ALERT_TYPE",
    "id": "$ID",
    "last_updated": "$LAST_UPDATED",
    "event_type": "$EVENT_TYPE",
    "title": "$EVENT_TITLE",
    "date": "$DATE",
    "org": {
        "id": "$ORG_ID",
        "name": "$ORG_NAME"
    },
    "body": "$EVENT_MSG"
}
```

<figure><img src="https://4061983002-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgIMm5p2V7PNx3dS7vwKE%2Fuploads%2FB4zB6LDnWCTOraHNXv1g%2Fdatadog-webhook-config.png?alt=media&#x26;token=9c33f166-9d15-456c-b81a-ab08713b6450" alt=""><figcaption></figcaption></figure>

### Create your Synthetic Monitor Test in Datadog

Next, you need to configure your synthetic monitor in Datadog and link it to the webhook you just created.

* **Navigate to Synthetics:** On the Datadog navigation bar, click on `Digital Experience`.
* **Create Uptime Monitor Test:** Click on `New Test` and create a new monitor for the synthetic you want to track using the **`API Test`** template. Configure the monitor according to your needs (e.g., check frequency, target URL).
* **Add Webhook:** On the settings configuration, add `@webhook-your-webhook-name` in the body of the message. (e.g., in the image below, my webhook's name is webhook-test)

<figure><img src="https://4061983002-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgIMm5p2V7PNx3dS7vwKE%2Fuploads%2F7JzBu64Ckrfl2nWgaBPv%2Fdatadog-link-webhook-.png?alt=media&#x26;token=585bbcc1-7cfd-471d-ae07-09469481e876" alt=""><figcaption></figcaption></figure>

That's it! Once you have completed these steps, Datadog will send notifications about your uptime checks to StatusPal, allowing you to monitor and manage your service availability from a centralized platform.
