# Datadog

[<mark style="color:blue;">Datadog</mark>](https://www.datadoghq.com/) is a monitoring platform for cloud applications that bring in together data from servers, containers, databases, and third-party services, thus providing observability into the entire stack.

Route detailed monitoring alerts from Datadog to the right users in Squadcast.

### How to integrate Datadog with Squadcast

### In Squadcast: Using Datadog as an Alert Source

1. Navigate to **Services** -> **Service Overview** -> select or search for your Service. Expand the accordion -> In the Alert Sources section, click **Add**.

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-4fbd74e7ca0b30173c47a1d58ed6a0804a0465aa%2FAlert_Sources.png?alt=media\&token=aaca6610-9d18-4dd4-9cf5-320042f326f1)

2\. Select **Datadog**. Copy the displayed **Webhook URL** to [configure](#in-datadog-create-a-squadcast-webhook) it within **Datadog**. Finish by clicking **Add Alert Source** -> **Done**.

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-e313031cc48eea72933865e29360590877f5ecd0%2FDatadog.png?alt=media\&token=7a9ba383-1d33-4636-b4c7-60fc6e3f405b)

{% hint style="warning" %} <mark style="color:orange;">**Important**</mark>**:**

When an alert source turns <mark style="color:green;">Active</mark>, it’ll show up under Configured Alert Sources. You can either generate a test alert from the integration or wait for a real-time alert to be generated by the Alert Source.\
\
An Alert Source is <mark style="color:green;">active</mark> if there is a recorded incident via that Alert Source for the Service.
{% endhint %}

### In Datadog: Create a Squadcast Webhook

1. Open the **Integrations** page from the sidebar

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-718d2a3d580177f2d45414274e7e5b5b08a82375%2Fdatadog_2.png?alt=media\&token=94832152-878f-4da1-a563-78b03d43eab0)

2. Search for **Webhooks**. Once the Webhooks tile appears, hover over it and click on "Configure"

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-071ff6119bec9e886623b5c574a5436d2b185478%2Fdatadog_3.png?alt=media)

3. Navigate to the **Configuration** tab

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-204f052aa57bdd880f0e5a2463a68cd242c24f85%2Fdatadog_4.png?alt=media)

4. Scroll to the bottom of the page. Click on `New Webhook` to add a new Webhook URL

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-06626c4b655dadc5fb65279d71a4105a249dfe93%2Fdatadog_5.png?alt=media)

5. (a) Give the Webhook a name in the Name field

(b) Paste the **Datadog Webhook URL** provided by Squadcast in the URL field

(c) Copy-paste the following JSON in the text box under the **Payload** section

```json
{
    "alertId": "$ALERT_ID",
    "eventMessage": "$TEXT_ONLY_MSG",
    "title": "$EVENT_TITLE",
    "url": "$LINK",
    "alertTransition": "$ALERT_TRANSITION",
    "hostname": "$HOSTNAME",
    "orgName":"$ORG_NAME",
    "priority":"$PRIORITY",
    "snapshot": "$SNAPSHOT",
    "alertQuery": "$ALERT_QUERY",
    "alertScope": "$ALERT_SCOPE",
    "alertStatus": "$ALERT_STATUS",
    "eventType": "$EVENT_TYPE",
    "event_id": "$ID",
    "alert_metric": "$ALERT_METRIC",
    "alert_priority": "$ALERT_PRIORITY",
    "alert_title": "$ALERT_TITLE",
    "alert_type" : "$ALERT_TYPE",
    "event_msg" : "$EVENT_MSG",
    "incident_pub_id" : "$INCIDENT_PUBLIC_ID",
    "incident_title" : "$INCIDENT_TITLE",
    "incident_url" : "$INCIDENT_URL",
    "incident_msg" : "$INCIDENT_MSG",
    "security_rule_id" : "$SECURITY_RULE_ID",
    "security_rule_name" : "$SECURITY_RULE_NAME",
    "security_signal_severity" : "$SECURITY_SIGNAL_SEVERITY",
    "security_signal_title" : "$SECURITY_SIGNAL_TITLE",
    "security_signal_msg" : "$SECURITY_SIGNAL_MSG",
    "security_rule_query" : "$SECURITY_RULE_QUERY",
    "security_rule_type" : "$SECURITY_RULE_TYPE",
    "tags" : "$TAGS"
}
```

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-fe676e771c914ba1f3161e766b89e5d5199aedc2%2Fdatadog_6.png?alt=media)

Click on “Save” to complete the service integration.

{% hint style="info" %} <mark style="color:blue;">**Note**</mark>**:**\
\
You can find detailed information on the variables supported by Datadog that are available within the alert payload in Squadcast [here](https://docs.datadoghq.com/integrations/webhooks/).
{% endhint %}

{% hint style="warning" %} <mark style="color:orange;">**Important**</mark>**:**\
\
Once the Webhook for Squadcast has been configured, ensure that the same is also selected as a channel within **Notify your team** about the **Monitor's** configuration.
{% endhint %}

That's it, you are good to go! Your Datadog integration is now complete.

* Now, whenever Datadog fires an alert, an incident will be created in Squadcast for it.
* When the alert recovers in Datadog, the corresponding incident will **automatically get resolved** in Squadcast as well.

*Have any questions?* [*Ask the community*](https://community.squadcast.com/view/home)*.*
