I was at a newrelic training in utrecht and saw a nice feature that in the APM you can filter on host, but we don’t have that dropdown. (screenshot from the demoacount firstname.lastname@example.org):
So i was wondering why that doesn’t snow up on our environment, and i think that is because we have the same hostname for all ec2 instances. Reading the docs i found i can overwrite that in two ways, where the most easy for us would be a environment variable, because we use have a “post deploy” powershell script which makes it easy to set an variable.
So, on the dev server i tested my script and great success, i’ve set an enviroment variable:
[Environment]::SetEnvironmentVariable(“NEW_RELIC_PROCESS_HOST_DISPLAY_NAME”, $instanceId, “Machine”)
resulting in this:
The docs also said to Restart your application, so just to be on the safe side i rebooted the machine. But even after an hour i log in to the NR APM i don’t see the ec2 name i want, but the hostname:
Anyone have any clues what i forgot or did wrong? And is my assumption that having all the same host names makes it so that we don’t have a dropdown to filter on host?
Sidenote: Our dev env only has one server, so i would expect i couldn’t filter there, but that the name i set as environment variable would show up in APM instead of the hostname.