Retrieve AWS instance-id from NewRelic Server data?

Hi there – after deleting a server from EC2, I would like to run some API calls in NewRelic on the server object. AWS delivers me some data about terminated instances, but NOT the hostname. The best key to the data I get from AWS notifications is the instance-id. Is there a nice way to take an instance-id and figure out what NewRelic server it belongs to? I can’t go back to the server itself, as it has been deleted.

I’m using an AMI so I don’t edit the NewRelic configuration file by hand or use configuration management in this particular case, and I also don’t want to store a mapping in a third datastore just to do this one lookup. Surely NewRelic has enough AWS users that storing the instance-id is something the agent will do?


@martin_newrelic The New Relic Server monitoring agent relies upon the host name to determine what server specific metrics values belong to. The AWS Instance ID is not information that is currently queried or stored by New Relic.

I can see how this information could be useful to AWS users. I am creating a feature request for this utility with our product ideas team. While we can not promise when or if this functionality will become available we do use these requests when planning our future product roadmap.

1 Like

Thanks! That would be super.

I too would love to have an instance’s ID be reported rather than hostname.

Our AWS instances are very short-lived (only from hours to days long), and hostnames (being based on DHCP granted IPs) can get re-used for new instances. Conversely, the EC2 Instance ID is relatively unique and useful for identifying a particular instance.

Also, it’s very easy to gather, via this on any instance itself:


Great feedback and thank you for that tip, @roens! I have sent this on to our product managers to check out.

Is it still not possible to get data by AWS instance ID?

Hi, @wasae.shoaib: New Relic Servers is nearing its end of life, so I wouldn’t expect any new features. New Relic Infrastructure, however, does expose the EC2 Instance ID: