Alerting on Individual Instances in New Relic

Hello,
I’m trying to setup alerting for our non prod environment. We haven’t used NR before
We have our instances in an AutoScaling group in AWS.

I’ve created an alert and when it alerts the incident doesn’t tell us which individual instance caused the issue. It just mentions the ASG as a whole (see screenshot shown below)

How can we see which EC2 instance was at fault?

image

Here is the query
SELECT count(*) FROM Transaction WHERE appName = ‘our application name’ FACET host EXTRAPOLATE

When Im looking at the APM overview page our EC2 instances are showing as follows. At the time of this screenshot the ASG had only 1 instance. Most times it has 5 or 6
At time of the alert it had 5

Thanks

Hi, @paul.donnelly: As I mentioned in the other topic, you can pass the instance name or ID as a custom attribute in your application code. It will then be available as a value on which you may FACET in your NRQL alert condition.

Without adding an instance ID, I don’t know how you can do it.

Hi @philweber we wont know the instance name or ID as the ASG will spin up new machines with new names.
So basically to setup a custom attribute we first need to know what the new instance name or ID will be that the ASG spins up? Once known we then create the attribute?
This ASG could be creating new instances each night.

I assume your code can get the name of the host on which it is executing? If so, in your code, you pass that name as a custom attribute. In what language is your application written?

Another possibility is to set the display_name setting in the New Relic agent configuration file to reflect the instance name rather than the AWS autoscaling group name.

@philweber I’ll get back on that as the developer isnt available just now

1 Like