New Relic Alerts (New) Integration

New Relic is the all-in-one web application performance tool that lets you see performance from the end user experience, through servers, and down to the line of application code. 

New Relic Alerts is New Relic's new incident management platform that offers a centralized monitoring for all New Relic products.

OpsGenie is an alert and notification management solution that is highly complementary to New Relic Alerts.

What does OpsGenie offer to New Relic users? 

OpsGenie has a native integration with New Relic Alerts. Using the integration, New Relic sends incidents to OpsGenie API, with detailed information. OpsGenie acts as a dispatcher for New Relic incidents, determining the right people to notify based on on-call schedules, using email, text messages (SMS), phone calls and iPhone & Android push notifications, and escalating alerts until the alert is acknowledged or closed.

This document describes how to configure the integration and details of data that OpsGenie receives from New Relic.


Functionality of the integration

  • When an alert is created in New Relic Alerts, an alert is also created in OpsGenie automatically through the integration.
  • When an alert is closed in New Relic Alerts, the related alert is also closed in OpsGenie automatically through the integration.
  • When an alert is acknowledged in New Relic Alerts, the related alert is also closed in OpsGenie automatically through the integration.

Configuring OpsGenie side of the integration

  1. Please create an OpsGenie account if you haven't done already.
  2. Go to OpsGenie New Relic Integration page,
  3. Specify who should be notified for New Relic incidents using the "Teams" field. Auto-complete suggestions will be provided as you type. 
  4. Copy the API key by clicking on the copy button or selecting.
  5. Click on "Save Integration".

Configuring New Relic side

  1. In New Relic Alerts, select "Notification channels" tab.
  2. Click "New notification channel".
  3. Select "OpsGenie" as channel type.
  4. Paste the API key you copied into "API key" field.
  5. Click "Create channel".
It's recommended to set "Incident preference" as "By condition and target" in the alert policies that use OpsGenie channel.

All done! You should now be able to forward your New Relic incidents to OpsGenie and leverage OpsGenie's full alerting functionality.

Sample JSON payload sent from New Relic to OpsGenie

{
      "tags": "tag1,tag2",
      "teams": "team1,team2",
      "recipients": "user1,user2",
      "payload": {
        "condition_id": 1,
        "condition_name": "test condition",
        "current_state": "open",
        "details": "CPU > 50% for 5 minutes",
        "event_type": "INCIDENT",
        "incident_acknowledge_url": "http://localhost/incident/1/acknowledge",
        "incident_api_url": "http://localhost/api/incident/1",
        "incident_id": 1,
        "incident_url": "http://localhost/incident/1",
        "owner": "John Doe",
        "policy_name": "test policy",
        "policy_url": "http://localhost/policy/1",
        "runbook_url": "http://localhost/runbook/url",
        "severity": "CRITICAL",
        "targets": [
          {
            "id": "12345",
            "link": "http://localhost/target/12345",
            "name": "Test Target",
            "labels": [
              "production",
              "hostname"
            ],
            "type": "Server",
            "product" : "productName"
          }
        ],
        "timestamp": 123456789000
      }
}

This payload is parsed by OpsGenie as:

[
    "owner" : "John Doe",
    "severity" : "CRITICAL",
    "policy_url" : "http://localhost/policy/1",
    "teams" : [
        "team1", "team2"
    ],
    "target_name" : "Test Target",
    "target_type" : "Server",
    "policy_name" : "test policy",
    "incident_url" : "http://localhost/incident/1",
    "incident_acknowledge_url" : "http://localhost/incident/1/acknowledge",
    "tags" : [
        "tag1", "tag2"
    ],
    "event_type" : "INCIDENT",
    "incident_id" : "1",
    "target_link" : "http://localhost/target/12345",
    "runbook_url" : "http://localhost/runbook/url",
    "recipients" : [
        "user1", "user2"
    ],
    "target_labels" : [
        "production", "hostname"
    ],
    "details" : "CPU > 50% for 5 minutes",
    "state" : "open",
    "condition_name" : "test condition",
    "target_product" : "productName",
    "timestamp" : "123456789000"
]

Sample alert