I'm using New Relic for Rails, but only need New Relic to monitor my one production environment. However, I have a staging server that also runs in Production mode. New Relic detects both as operating prod instances of my application (as it should), but I don't want to have to pay for monitoring two instances when I only want to keep an eye on the one.
New Relic accepts an environment variable for the license key:
license_key: <%= ENV['NEWRELIC_ACCOUNT_KEY'] %>
Is it possible to detect the hostname in the environment files (i.e. config/environments/production.rb) so that I can define this environment variable dynamically?
Both environments are deployed from the same Git repository, same source code base, so I can't really change it in the code for each deploy - it would be best to be able to define the environment variable dynamically somehow.
Any thoughts would be appreciated! Thanks!