Alerting on individual instances

Hello,

I’m new to using New Relic and I need to set up alerting on our individual instances.
We have an application being monitored by APM and have 6 EC2 instances in an autoscaling group.
If the application alerts it doesn’t inform me which of the six instances is having an issue. It basically alerts as an application issue.

Can someone tell me how to set up alerts so if there is an issue with the application it will tell me which instance is having the issue? Is there an alert that needs configured using NRQL?

Thanks for assistance on this

Hi, @paul.donnelly: If it is a Java application, you may select Scope to Java application instances when you create an alert condition:

For non-Java applications, you may be able to use an NRQL condition to monitor individual instances; it depends which metric(s) you want to monitor. Can you provide more information?

Hi @philweber thanks for you reply.
I would need to confirm with the application developer if its java based or not.

One thing I noticed is when I tried the steps you showed above, I was not able to see the application as an option for an entity.

I guess if I cant see it when using a condition of ’ Application metric’ then that it means it not a Java app and that option wont work?

In that case I would need to use NRQL? If so then, with your help, I could try an alert based on throughput and test if that works.
Once confirmed I could then add in whatever else is required to be alerted on

Thanks

I guess if I cant see it when using a condition of ’ Application metric’ then that it means it not a Java app and that option wont work?

That is correct.

If so then, with your help, I could try an alert based on throughput and test if that works

Try this query:

SELECT count(*) FROM Transaction WHERE appName = 'Your Application' FACET host EXTRAPOLATE

The FACET hostname is what will identify which instance violated the threshold.

1 Like

Thanks @philweber

When I open Alert Conditions it tells me that I have no alerts configured.
This will be because the alert is using NRQL right?
And once I have notifications setup the throughput alert will only notify through the notification I have configured and nothing will show on the APM overview page? Is there no way to have any kind of dashboard setup for this alert that shows any further information?

Hi, @paul.donnelly: Apologies, there was an error in my NRQL query above: It should have said FACET host, not hostname. I have corrected my previous post for future generations.

If you use entityGuid in the WHERE clause rather than appName, then New Relic will recognize that the NRQL condition applies to your application. You may view your app’s metadata to find its GUID: Get app and other IDs in New Relic One | New Relic Documentation

SELECT count(*) FROM Transaction WHERE entityGuid = 'Your App’s GUID' FACET host EXTRAPOLATE

Thanks @philweber
I was able to trigger an alert which sent a notification to PagerDuty :smiley:
The only issue is that the alert in NR showed the FACET as our autoscaling group and not individual instances.
Is this because we have our instances listed in the APM dashboard as being in our ASG (5 in total)? As opposed to being listed individually?
Is there a document on how to list instances individually?

Your alert condition is FACETed by host; your environment is reporting the auto-scaling group name as the host, so that is what gets reported in the alert notification. You can view the available Transaction attributes here: New Relic data dictionary | New Relic Documentation. If there is one that contains the instance name, you may FACET on that attribute instead of host.

If there is not an existing attribute that contains the instance name, you may create a custom attribute to send this data to New Relic.