Closed Bug 1182425 Opened 10 years ago Closed 10 years ago

Add a newrelic.ini file to the repo so we can customise the New Relic settings on Heroku/stage/prod

Categories

(Tree Management :: Treeherder: Infrastructure, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: emorley, Assigned: emorley)

References

Details

Attachments

(1 file)

There are some settings that cannot be set using the New Relic dashboard settings page, and must be defined in newrelic.ini We can commit this file to the repo and then use the NEW_RELIC_CONFIG_FILE env variable to point to it. https://docs.newrelic.com/docs/agents/python-agent/hosting-services/python-agent-heroku#agent-configuration-file
Summary: Add a newrelic.ini file to the repo so we can customise the New Relic settings on Heroku → Add a newrelic.ini file to the repo so we can customise the New Relic settings on Heroku/stage/prod
Assignee: nobody → emorley
Status: NEW → ASSIGNED
Attachment #8688550 - Flags: review?(wlachance)
Comment on attachment 8688550 [details] [review] Add a config file for the New Relic Python agent This makes good sense! Thanks.
Attachment #8688550 - Flags: review?(wlachance) → review+
Commit pushed to master at https://github.com/mozilla/treeherder https://github.com/mozilla/treeherder/commit/9ca5cb376360de97649eb9cfdee0b477cb8ed97b Bug 1182425 - Add a config file for the New Relic Python agent The settings for the New Relic Python agent are defined via the following methods (later items override the earlier ones): 1. Agent defaults 2. Environment variables 3. Local agent configuration file (iff `NEW_RELIC_CONFIG_FILE` set) 4. Server-side configuration (ie via the New Relic website) 5. Per-request configuration Some settings can only be controlled by a subset of these methods, eg the more security-sensitive ones (like whether request parameters should be recorded) must be set via [3]. In addition, once [4] is activated, *all* settings that can be set via their website will override those from 1-3, even if they are set to the empty string. As such, it's recommended to *only* use the local agent config file for settings that are unavailable on the website. Stage/prod do currently have their own config file (managed via puppet, forked from the standard IT config), however it turns out it's unused since `NEW_RELIC_CONFIG_FILE` isn't defined. This explains why bug 1141036 didn't actually make any difference. To change New Relic settings (that can't be set via the website) on Heroku, we're going to need to commit a config file to the repo anyway, so we might as well use that same file for stage/prod too, so we can modify the config there without requiring puppet changes. I've not copied the unused stage/prod config file from puppet, since it's crufty and mostly contains defaults. This commit is a no-op until `NEW_RELIC_CONFIG_FILE` is defined in each environment. The `log_file` setting within will make the NEW_RELIC_LOG environment variable redundant. That variable is currently set to 'stderr' for stage/prod and 'stdout' for Heroku, so I've settled on 'stdout'. In later bugs (eg for bug 1223496) more useful options will be added, but we'll at least be able to start pointing at the config file using `NEW_RELIC_CONFIG_FILE` in the meantime. For the agent defaults and more info, see: https://docs.newrelic.com/docs/agents/python-agent/installation-configuration/python-agent-configuration
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Blocks: 1225634
I rebased the autoclassify branch on master, and then set the env var so Heroku is now using the config file. [~/src/treeherder]$ heroku config:set NEW_RELIC_CONFIG_FILE=newrelic.ini Setting config vars and restarting treeherder-heroku... done, v570 NEW_RELIC_CONFIG_FILE: newrelic.ini [~/src/treeherder]$ heroku config:unset NEW_RELIC_LOG Unsetting NEW_RELIC_LOG and restarting treeherder-heroku... done, v571
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: