I use New Relic for Rails, but I need a new relic to monitor my work environment. However, I have an intermediate server that also works in production mode. The new relic discovers both operational instances of my application (as it should be), but I do not want to pay for monitoring two instances when I only want to monitor it.
The new relic accepts an environment variable for the license key:
license_key: <%= ENV['NEWRELIC_ACCOUNT_KEY'] %>
Is it possible to define the host name in environment files (i.e. config / environment / production.rb) so that I can dynamically define this environment variable?
Both environments are deployed from the same Git repository, the same source code base, so I cannot change it in the code for each deployment - it would be best to somehow dynamically define the environment variable.
Any thoughts would be appreciated! Thanks!
source
share