Integrate with Datadog
What does the integration offer?
Compass has a native, powerful bidirectional integration with Datadog. Use the integration to automatically sync your Datadog alerts with Compass alerts, and benefit from Compass's rich alert notification system, escalations, and on-call rotations.
How does the integration work?
Datadog triggers an alert when a defined condition is matched. When an alert is created in Datadog, an alert is also created in Compass automatically through the integration.
Create alerts in Compass from Datadog UI by @mentioning Compass service in the text.
When the alert is acknowledged in Compass, alert is acknowledged automatically in Datadog as well.
When the alert is closed in Compass, alert is closed automatically in Datadog as well.
When an alert is created in Compass from any source (other than Datadog), Compass is able to post the alert to Datadog (optional).
Acknowledge (or close) the alerts from Datadog using Datadog's @opsgenie-acknowledge and @opsgenie-close commands in a comment.
Set up the integration
Datadog is a bidirectional integration. Setting it up involves the following steps:
Add a Datadog integration in Compass
Configure the integration in Datadog
Add a Datadog integration
In this release, only incoming integrations are fully supported in the Standard plan, at a team level. To use outgoing integrations or the outgoing part of bidirectional integrations, upgrade to a higher subscription plan. There may be restrictions on how you can create and apply integration rules as well.
You can add this integration only from your team’s operations page. Adding an integration from your team’s operations page makes your team the owner of the integration. This means Compass only assigns the alerts received through this integration to your team.
To add a Datadog integration in Compass, complete the following steps:
Go to your team’s operations page.
On the left navigation panel, select Integrations and then Add integration.
Run a search and select “Datadog”.
On the next screen, enter a name for the integration.
Optional: Select a team in Assignee team if you want a specific team to receive alerts from the integration.
Select Continue.
The integration is saved at this point.Select Edit on the integration configuration page.
The Edit integration settings dialog opens.Select Authenticate with a Datadog account.
Paste the Datadog API key into Datadog API key.
Expand the Steps to configure the integration section and copy the API key.
You will use this key while configuring the integration in Datadog later.Select Turn on integration.
The rules you create for the integration will work only if you turn on the integration.
Configure the integration in Datadog
To configure the integration in Datadog, complete the following steps:
In Datadog, select Integrations > Integrations.
Select Opsgenie.
Open the Configuration tab.
Paste the API key previously copied from Compass into the text field under Service Key (apiKey).
Enter a service name.
Select Install Integration.
To test the integration, simply make a post with @opsgenie (that is, @opsgenie This is a test alert!) in the "Events" page. This creates an alert in Compass and shows up in your Datadog Events page.
Sample payloads sent from Datadog to Compass
Metric alert payload
JSON
{
"event_url": "",
"last_updated": 1397628633000,
"event_type": "metric_alert",
"snapshot_link": "https://app.datadoghq.com/alert/alert_state?alert_id=51950&to_ts=1397628600000&aggr=avg&scope=host%3Aismet-if&metric=system.disk.free&from_ts=1397627940000",
"msg_title": "[Triggered] system.disk.free",
"monitor_data": {
"snap_url": "https://p.datadoghq.com/snapshot/view/dd-snapshots-prod/org_2305/2014-07-23/6803a21774c63347c032d92a2aff01ababfba231.png",
"group": "guruop",
"name": "aws.dynamodb.returned_item_count",
"type": "metric alert",
"group_key": "key5",
"query":"min(last_5m):avg:system.cpu.idle{*} < 99",
"message": "@opsgenie-service_1",
"org_id": 2305,
"id": 59482,
"metric": "system.cpu.idle"
},
"dd_tags": [
"alert",
"tag2"
],
"message": "%%%\n@opsgenie-team \n\n[](https://app.datadoghq.com/alert/alert_state?alert_id=51950&to_ts=1397628600000&aggr=avg&scope=host%3Aismet-if&metric=system.disk.free&from_ts=1397627940000)\n\n**system.disk.free** over **host:ismet-if** was **> 1** on average during the **last 10m**.\n\n\n%%%",
"event_id": "2237506288020066106",
"snapshot_url": "https://p.datadoghq.com/snapshot/view/dd-snapshots-prod/org_8283/2014-04-16/7103f56dfa041445fb099f014ca5a3fce0cfcaea.png",
"priority": "normal",
"alias": "ad07c3317c7a1f9a35ea4ac2fdb5d706",
"msg_text": "%%%\n@opsgenie-team \n\n[](https://app.datadoghq.com/alert/alert_state?alert_id=51950&to_ts=1397628600000&aggr=avg&scope=host%3Aismet-if&metric=system.disk.free&from_ts=1397627940000)\n\n**system.disk.free** over **host:ismet-if** was **> 1** on average during the **last 10m**.\n\n\n%%%",
"action": "create",
"templated_message": "temp msg",
"source_type_name": "Monitor Alert"
}
Compass parses the payload as follows:
JSON
[
"last_updated": 1397628633000,
"message_title": "[Triggered] system.disk.free",
"query": "min(last_5m):avg:system.cpu.idle{*} < 99",
"snapshot_url": "https://p.datadoghq.com/snapshot/view/dd-snapshots-prod/org_2305/2014-07-23/6803a21774c63347c032d92a2aff01ababfba231.png",
"message": "@opsgenie-service_1",
"priority": "normal",
"event_url": "",
"monitor_name": "aws.dynamodb.returned_item_count",
"snapshot_link": "https://app.datadoghq.com/alert/alert_state?alert_id=51950&to_ts=1397628600000&aggr=avg&scope=host%3Aismet-if&metric=system.disk.free&from_ts=1397627940000",
"templated_message": "temp msg",
"event_type": "metric_alert",
"event_id": "2237506288020066106",
"metric": "system.cpu.idle",
"alias": "ad07c3317c7a1f9a35ea4ac2fdb5d706",
"action": "create",
"dd_tags": [
"alert",
"tag2"
],
"group": "guruop",
"group_key": "key5",
"source_type_name": "Monitor Alert"
]
@opsgenie-acknowledge command payload
JSON
{
"last_updated": "1456994681000",
"msg_title": "null",
"user_name": "halit okumus",
"user_handle": "halit.okumus@ifountain.com",
"snapshot_url": "null",
"source": "null",
"msg_text": "@opsgenie-acknowledge I am on it",
"priority": "normal",
"message": "@opsgenie-acknowledge I am on it",
"event_url": "",
"snapshot_link": "null",
"dd_tags": [
"alert",
"tag2"
],
"event_type": "api",
"event_id": "3233503302758961154",
"monitor_data": "null",
"alias": "f769ea8a-1e8c-48c1-943f-b51792e14de8",
"action": "acknowledge",
"alertId": "f769ea8a-1e8c-48c1-943f-b51792e14de8"
}
@opsgenie-close command payload
JSON
Sample payload sent from Compass to Datadog
JSON