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

NoticeError and Email Notifications

alerts
java
api

#1

Hello,

I would like to use the noticeError method (if possible) within my code, that then triggers an alert policy condition, which will send out the proper email notifications.

Is it possible to trigger an alert policy condition by using noticeError or is there another means of doing this?

Thanks,
Kevin


#2

Hi, @kevin.r.hanson: noticeError() just sends information about an error to New Relic. Once New Relic has the data, however, there are multiple ways you can use it to trigger an alert violation:

  • If the transaction experiencing the error is a key transaction, you may create a key transaction alert condition to trigger a violation based on error count or error rate;

  • If the transaction is not a key transaction, or if you want to trigger a violation based on specific errors, you may create a NRQL alert condition, for example:

    SELECT count(*) FROM TransactionError WHERE appName = 'My Application' AND 
    `error.message` = 'Error 1'

#3

Hi, @philweber! Thanks for the information.

I have a question, if I have two types of error messages that start off with the same text (string)

message1 = “This is a test for A site!”
message2 = “This is a test for B site!”

and I want to use the same NQRL alert condition, would it look like the statement below?

SELECT count(*) FROM TransactionError WHERE appName = ‘My Application’ AND
error.message = ‘This is a test for %’


#4

Close:

...WHERE error.message LIKE 'This is a test%'

#5

Hi, @philweber ! Thanks for that update/answer. I do have one more question.

When using WHERE error.message LIKE ‘This is a test%’ and it came from ‘Site A’ will the alert email show ‘This is a test Site A’ or just ‘This is a test’? I would like to display the full error message in the alert email.

Thanks,
Kevin Hanson


#6

Hi, @kevin.r.hanson: If you add a …FACET error.message, the notification will include the full error message: