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

alerts
insights

#22

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:


#23

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


#24

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


#25

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


#26

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!


#27

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]

#28

Have you implemented this before ? Any suggestions ?


#29

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.


#30

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.


#31

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


#32

I don’t think you can.


#33

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.


#35

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',
       latest(details)
FROM alert
FACET incident_id
SINCE 1 day ago
LIMIT 99

Useful Insights NRQL queries library
#36

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


#37

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


#38

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


#39

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


#40

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


#41

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.

    }

#42

@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.