Skip to main content
OpenSRE queries New Relic during alert investigations — pulling open and recent alert incidents (with the condition and policy that fired) and running NRQL metric queries correlated with incidents.

Prerequisites

  • New Relic account
  • A User key (starts with NRAK-) — not a License key. This is the most common setup mistake: License keys authenticate agents that send data to New Relic, not the NerdGraph API that OpenSRE reads from. A License key will fail verification.
  • Your account ID

Setup

Option 1: Interactive CLI

Or run opensre onboard and select New Relic in the Observability group. You will be prompted for the API key, account ID, and API URL.

Option 2: Environment variables

Add to your .env:
Both NEW_RELIC_API_KEY and NEW_RELIC_ACCOUNT_ID must be set — either one alone leaves the integration unconfigured. For multiple New Relic accounts, use multi-instance with NEW_RELIC_INSTANCES.

Option 3: Persistent store

Creating a User key

  1. In New Relic, go to your user menu → API keys
  2. Click Create a key
  3. Set the key type to User key (not License key)
  4. Copy the key — it starts with NRAK-

Finding your account ID

Your account ID is shown in New Relic under AdministrationAccount settings, and also appears in the URL when you’re viewing an account-scoped page (.../accounts/<account_id>/...).

Verify

Expected output:
Inside the REPL: /integrations verify new_relic or /verify new_relic.

Alerts require an existing alert condition

New Relic alert data becomes available only after at least one configured alert condition has fired. If your account has no alert policies and conditions yet, OpenSRE will correctly return zero incidents — that’s not a misconfiguration, there’s simply nothing to read yet. Set up an alert condition in New Relic first if you want alert investigations to return data.

Troubleshooting

Security best practices

  • This integration is read-only: OpenSRE only ever runs NerdGraph query operations against your account, never a mutation.
  • Store the User key in .env or your secret manager — not in source control.