docs

New Relic

Receive New Relic issue notifications in Plural

A New Relic webhook delivers issue notifications from a New Relic workflow into Plural. Each notification is one alert, keyed by the New Relic issue ID, so later notifications for the same issue update it.

An alert does not start a job by itself. A job starts only when a webhook trigger on a workbench matches the alert, and only when the issue starts firing: the first activated notification for an issue, or one that follows a resolved notification. Later notifications for an issue that is still active do not start another job, and an issue starts at most one job per workbench per hour.

What Plural reads from the payload

Plural reads the fields of the workflow's default webhook payload:

json
{
  "id": "d1b1f3fd-995a-4066-88ab-8ce4f6960654",
  "issueUrl": "https://radar-api.service.newrelic.com/accounts/1/issues/0ea2df1c-...",
  "title": "Memory Used % > 90 for at least 2 minutes on 'checkout'",
  "priority": "CRITICAL",
  "state": "ACTIVATED",
  "alertConditionNames": ["Memory high"],
  "plural": "plrl_project: payments, plrl_cluster: prod-us-east, plrl_service: checkout"
}
  • id identifies the alert. Keep the issue ID here: notifications without an id all update one shared alert.
  • state sets the state. ACTIVATED is firing and RESOLVED is resolved. Plural does not store a notification with any other state, including New Relic's CREATED and CLOSED. See Send closed issues as resolved.
  • title becomes the alert title, and issueUrl the link back to New Relic.
  • priority sets the severity: CRITICAL is critical, and every other priority is medium.
  • title and alertConditionNames become the alert summary. Without condition names, Plural uses message.

Associate alerts with Plural resources

Plural keeps an alert only when it belongs to a Plural project, cluster, or service, or when a workbench trigger matches it. Otherwise the notification is acknowledged and ignored.

Plural searches the whole payload for plrl_project: <name>, plrl_cluster: <handle>, and plrl_service: <name>. The service is looked up on that cluster. Each value ends at the next comma or whitespace, so put all three in one string field, such as the plural field above, in that order with a comma after each value but the last. A value right before a closing quote, other than plrl_service, includes the quote and does not match.

If nothing resolves, Plural looks for markers in the title and summary: Plural Project: <name>, Plural Cluster: <handle>, and Plural Service: <name>, or the forms plrl-project-<name>, plrl-cluster-<handle>, and plrl-service-<name>. A service marker also needs the cluster.