esc
↑↓ move↵ openesc close
Connectors · Errors & on-call

Connect New Relic

Run the NRQL you already trust, and see New Relic's alert issues the moment they open, in your Mac's notch, with your own User key.

You need
User key Your name › API keys
The form asks
  • Connector name
  • Region
  • Account ID
  • User key
You can watch
  • NRQL query
  • Open issues
Access
NerdGraph queries only: NRQL and alert issues
On this page

To connect New Relic to CoIsland you need a User key of your own and your account ID. No admin, no app to register. CoIsland calls NerdGraph, New Relic’s GraphQL API, straight from your Mac, keeps the key in your login Keychain, and only ever reads.

Create a New Relic User key

  1. Sign in at one.newrelic.com (or one.eu.newrelic.com for an account in the EU region).
  2. Open the menu under your name, then API keys.
  3. Select Create a key, choose User as the key type, name it CoIsland, and select Save.
  4. Copy the key: it starts with NRAK-.

A User key is tied to you and acts with your roles: CoIsland sees what you see. An admin can keep a user from viewing or managing keys by giving them a role without those permissions; if you cannot open API keys, ask them. When a user is deleted, their keys stop working. License and browser keys only send data and cannot be used.

Your account ID is the number beside the account name in New Relic’s account picker.

Connect New Relic in CoIsland

Open Settings › Connectors, click +, and choose New Relic.

Field What to enter
Connector name What monitors call it: newrelic.
Region Leave it on US, or pick EU if you sign in at one.eu.newrelic.com.
Account ID The number of the account to watch. A second account is a second connector.
User key The NRAK- key you created.

Test connector asks NerdGraph who you are and which accounts the key reaches; a key that does not reach the account ID lists the ones it does. Add Connector writes the account and region to ~/Library/Application Support/CoIsland/connectors.json and the key to your login Keychain. The key is only ever sent to https://api.newrelic.com/graphql or https://api.eu.newrelic.com/graphql, in the API-Key header.

Choose what to watch: the two New Relic monitor kinds

NRQL query

Any NRQL, as in the query builder. Each row it returns is watched the way a SQL monitor’s rows are: a new row alerts. Rows whose numbers change at every check (a count) are new every time, so name key columns, such as the facet, or alert on the row count instead. Checks every 5 minutes by default; NerdGraph gives a query up to 25 seconds.

SELECT count(*) FROM TransactionError FACET appName SINCE 10 minutes ago

With the rule Count crosses a threshold set to more than 0, that query alerts when any app has errors.

Open issues

Your account’s alert issues, as New Relic opens them: activated (alerting) unless you choose, or created, and the priorities you pick (critical, high, medium, low). An issue raised to a higher priority alerts again. Checks every minute by default.

priority:critical,high state:activated

What a New Relic alert shows

An NRQL alert shows its rows as a table. The notch lists an issue as Critical · Activated · checkout-api +1: how bad, where it stands, what it is about. Clicking it opens the alert in CoIsland, where the issue fills in with its state now, its entities and each incident’s title.

What a New Relic monitor’s watch file looks like

-- name: Errors by app
-- kind: newrelic.nrql
-- connector: newrelic
-- every: 5m
-- alert: count > 0

SELECT count(*) FROM TransactionError FACET appName SINCE 10 minutes ago

The kinds are newrelic.nrql and newrelic.issues.

Rate limits

NerdGraph limits each user to 25 requests at a time, shared by every key of that user; it does not limit how many you send. A check is one request per page of results. When New Relic answers 429, checks back off on their own.

Troubleshooting New Relic connector errors

  • New Relic refused the key. The key was mistyped or deleted, it is not a User key, or the region is not the account’s.
  • This key cannot reach account 123. The account ID is wrong, or your user has no access to it.
  • New Relic refused the query: then New Relic’s words, such as an NRQL syntax error.
  • Not allowed: … opt in to using experimental schemas. New Relic changed how its issues are read; update CoIsland.

Stuck? Open an issue on GitHub, or write to hello@coisland.app.

Docs