• Products
  • Get started
  • Documentation
  • Resources

Integrate Opsgenie with New Relic Alerts (New)

New Relic logo

What does Opsgenie offer New Relic users?

Opsgenie has a native integration with New Relic Alerts. Use the integration to send New Relic incidents to Opsgenie’s API with detailed information. Opsgenie acts as a dispatcher for New Relic incidents, determines the right people to notify based on on-call schedules– notifies via email, text messages (SMS), phone calls, and iPhone & Android push notifications, and escalates 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 acknowledged in Opsgenie automatically through the integration.

Configuring Opsgenie side of the integration

  1. Go to Opsgenie New Relic Integration page.

Under the Free and Essentials plans, the tabs under the Team dashboard are limited to Main, Integrations, Members, and Activity Stream.

2. Specify who is notified of New Relicc incidents using the Teams field. Auto-complete suggestions are provided as you type.

An alternative for Step 1) and Step 2) is to add the integration from the Team Dashboard of the team which will own the integration. To add an integration directly to a team, navigate to the Team Dashboard and open Integrations tab. Click Add Integration and select the integration that you would like to add.

3. Copy the API key.

4. Click Save Integration.

New Relic integration

Configuring New Relic side

  1. In New Relic Alerts, select "Notification channels" tab.

  2. Click New notification channel.

  3. Select "Opsgenie".

  4. Paste the API key copied previously from Opsgenie into the "API key" field.

  5. Select the team to route alerts to and the tags to attach to the alert.

  6. Click "Create Channel".

  7. Click Save changes.

New Relic Alerts

It's recommended to set "Incident preference" as "By condition and target" in the alert policies that use Opsgenie’s channel.

8. Navigate to the "Alert Policies" tab.

9. Click a desired alert to set up notification channels for.

10. Navigate to the "Notification Channels" tab.

11. Click "Add Notification Channel"

12. Select the Opsgenie channel set up in the previous steps.

All done! Now forward your New Relic incidents to Opsgenie and leverage Opsgenie’s full alerting functionality.

Sample JSON payload sent from New Relic to Opsgenie

JSON

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 { "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:

JSON

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 [ "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

New Relic sample alert
Last modified on Jan 29, 2021
Cached at 10:15 PM on Apr 14, 2021 |

Additional Help

Ask the Community