NewRelic Tag

Enable newrelic monitor on a host-by-host basis by checking for the presence of an AWS tag. By default, the tag is called 'NewRelic' and the expected setting is 'true'.

Configuration

Add newrelic_tag to your Gemfile.

At the top of newrelic.yml, require the library and configure it.

<% 
require 'newrelic_tag'
NewrelicTag.configure do |c|
  c.aws_access_key_id = '..key here..'
  c.aws_secret_access_key = '..secret here..'
  c.tag = 'new-relic'
  c.value = 'on'
end
%>

For each environment which should be controlled by tagging, set monitor_mode:

production:
  monitor_mode: <%= NewrelicTag.enabled? %>