Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 3 Current »

  • Mention of OG in content (not code). Do we need to edit or remove it?

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

Bidirectional integrations aren’t supported in the Standard plan. All the other integrations are supported at a team level in Standard.

If you're using the Standard plan in Compass, 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:

  1. Go to your team’s operations page.

  2. On the left navigation panel, select Integrations and then Add integration.

  3. Run a search and select “Datadog”.

  4. On the next screen, enter a name for the integration.

  5. Optional: Select a team in Assignee team if you want a specific team to receive alerts from the integration.

  6. Select Continue.
    The integration is saved at this point.

  7. Select Edit on the integration configuration page.
    The Edit integration settings dialog opens.

  8. Select Authenticate with a Datadog account.

  9.  Paste the Datadog API key into Datadog API key.

  10. 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.

  11. 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:

  1. In Datadog, select Integrations > Integrations.

  2. Select Opsgenie.

  3. Open the Configuration tab.

  4. Paste the API key previously copied from Compass into the text field under Service Key (apiKey).

  5. Enter a service name.

  6. 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[![Metric Graph](https://p.datadoghq.com/snapshot/view/dd-snapshots-prod/org_8283/2014-04-16/7103f56dfa041445fb099f014ca5a3fce0cfcaea.png)](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[![Metric Graph](https://p.datadoghq.com/snapshot/view/dd-snapshots-prod/org_8283/2014-04-16/7103f56dfa041445fb099f014ca5a3fce0cfcaea.png)](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

{
      "last_updated": "1456998760000",
      "msg_title": "null",
      "user_name": "halit okumus",
      "user_handle": "halit.okumus@ifountain.com",
      "snapshot_url": "null",
      "source": "null",
      "msg_text": "@opsgenie-close closing this one",
      "priority": "normal",
      "message": "@opsgenie-close closing this one",
      "event_url": "",
      "snapshot_link": "null",
      "dd_tags": [
            "alert",
            "tag2"
        ],
      "event_type": "api",
      "event_id": "3233571736653926401",
      "monitor_data": "null",
      "alias": "f769ea8a-1e8c-48c1-943f-b51792e14de8",
      "action": "close",
      "alertId": "f769ea8a-1e8c-48c1-943f-b51792e14de8"
    }

Sample payload sent from Compass to Datadog

JSON

{
  "apiKey": "2980d945-18b7-4371-9299-7ff60c21082c",
  "alert": {
    "createdAt": 1456756398904,
    "tinyId": "48",
    "alias": "alertAlias",
    "alertId": "5c1173aa-bbdb-4e32-b393-968b803b43d3",
    "source": "halit@opsgenie.com",
    "message": "OpsGenie test alert",
    "entity": "alertEntity",
    "updatedAt": 1456756398904000500,
    "username": "halit@opsgenie.com",
    "insertedAt": 1456756398904000500,
    "description": "test alert description",
    "tag": [
      "tag1",
      "tag2"
    ],
    "note": "test comment"      //only on AddNote action, note is put here as an example
  },
  "integrationName": "Datadog",
  "action": "Create",       //action can be Create, Close, AddNote or Acknowledge
  "integrationId": "2da74f28-3288-49e9-bad5-c97775e8b247",
  "source": {
    "name": "web",
    "type": "API"
  }
}

 

  • No labels