Your data. Anywhere you go.

New Relic for iOS or Android

Download on the App Store    Android App on Google play

New Relic Insights App for iOS

Download on the App Store

Learn more

Close icon

Sending Alerts data to Insights



Hey there @tstansell - Yep. We hear you! This is still the best workaround, though I acknowledge it is not ideal. I know you can understand that we just can’t get every issue addressed all the time. We have to make choices. Sorry this one is impacting you, but hopefully some of our other awesome new Alerts features lessen the pain? :slight_smile:


What is the JSON string to see the application name that violated the threshold?


Hello I am not receiving any data on the Targets field, other customer fields get populated. Would anyone know why ?


The targets field is in an array. You will need a way to flatten them so you can send it to insights.


Hi, @philweber Thank you for your post :slight_smile: I have a question for you:

Scenario: I created one NRQL alert, but the condition was violated and the incident was opened few hours ago, the details of the incident got sent to New Relic Insights.

Question: Is there a way that I can use NRQL to check if the incident current state is still opening now?

Thank you!


Hi, @Yiqian_Qin: If you know the incident ID, you can use this query to retrieve the current state:

SELECT latest(timestamp), latest(current_state), 
  latest(account_name), latest(policy_name), 
  latest(condition_name), latest(details) 
FROM Alert 
WHERE incident_id  = [the id]


Have you implemented this before ? Any suggestions ?


How can I include the ‘opened_at’ and ‘closed_at’ properties of the alert in the custom payload sent to Insights. I tried { “start”: “$OPENED_AT”, “end”: “$CLOSED_AT”} with no luck.


HI, @alex.tulikumwenayo: There are no ‘opened_at’ or ‘closed_at’ properties. New Relic Alerts generates separate events when an incident is opened or closed; the value ‘open’ or ‘closed’ is passed in the $EVENT_STATE attribute.


Thank you @philweber. How can I include the duration of the violation?


I don’t think you can.


Can I send vía payload the affected server of the alert?
I’m using Infrastructure product. I want to facet the chart by affected server.


FWIW, we have a recent alerts dashboard that uses the following NRQL to show recent alerts, including the duration of them:

SELECT max(timestamp) as 'Time',
       latest(current_state) as 'State',
       (max(timestamp)-min(timestamp))/60/1000 as 'Duration (min)',
       latest(severity) as 'Severity',
       latest(policy_name) as 'Policy',
FROM alert
FACET incident_id
SINCE 1 day ago

Useful Insights NRQL queries library

Hi @tstansell - That is a great NRQL query. Can you add it to the NRQL Library or link to your post in the library?


Is it possible to group alerts by “target” application? I’d like to produce a chart like:

app-1 |XXXXXXHHHHHHH (grouped by severity)
app-2 |XXXXHHH

… but I can’t see the ‘targets’ attribute in alert webhook payload in Insights


The targets field is in an array. You will need a way to flatten them so you can send it to insights.


How can I “flat” this array on Custom Alert webhook? I can’t find this information on documentation :slightly_frowning_face:


We send it to a function that takes the array apart / flatten it, then send it to insights.


I got the following error trying to test the webhook on the notification channel


    response: 200,

    Unable to invoke Webhook. Webhook responded with HTTP status code 403.



@David.Mijares - I took a look at your webhook notification channel, it seems like you are using X-Api-Key as your custom header.

That needs to be X-Insert-Key for the Insights API. Let us know your test goes if you get that updated.