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
2015-11-17 21:27:06 +03:00
|
|
|
# Options that can be set via the New Relic website (which is most of them)
|
|
|
|
# override any listed here, so this file should only be used for settings
|
|
|
|
# that are not available on the website to avoid confusion. See:
|
|
|
|
# https://docs.newrelic.com/docs/agents/python-agent/installation-configuration/python-agent-configuration
|
|
|
|
# The NEW_RELIC_CONFIG_FILE environment variable must point at this file,
|
2017-02-10 02:50:09 +03:00
|
|
|
# and both NEW_RELIC_APP_NAME + NEW_RELIC_LICENSE_KEY be set appropriately,
|
|
|
|
# unless NEW_RELIC_DEVELOPER_MODE is set.
|
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
2015-11-17 21:27:06 +03:00
|
|
|
|
|
|
|
[newrelic]
|
2018-08-15 12:35:14 +03:00
|
|
|
|
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
2015-11-17 21:27:06 +03:00
|
|
|
log_file = stdout
|
2018-08-15 12:35:14 +03:00
|
|
|
|
2015-11-18 03:51:13 +03:00
|
|
|
# Turn on the capturing of request parameters.
|
|
|
|
attributes.include = request.parameters.*
|
2018-08-15 12:35:14 +03:00
|
|
|
|
2016-05-03 19:38:29 +03:00
|
|
|
# Disable client-side monitoring JS injection, due to there being no way for
|
|
|
|
# users to opt-out. See:
|
|
|
|
# https://groups.google.com/forum/#!topic/mozilla.dev.webdev/ragGTzhyY2w
|
|
|
|
browser_monitoring.enabled = false
|
2017-02-16 20:04:08 +03:00
|
|
|
|
2018-08-15 12:35:14 +03:00
|
|
|
# Raise the maximum time allowed for the agent's final upload upon exit (default 2.5s),
|
|
|
|
# to make it less likely that New Relic submissions can get lost. The duration must be
|
|
|
|
# less than gunicorn's `graceful_timeout` (30 seconds).
|
|
|
|
shutdown_timeout = 15
|
|
|
|
|
2017-02-16 20:04:08 +03:00
|
|
|
[import-hook:django]
|
2018-08-15 12:35:14 +03:00
|
|
|
|
2017-02-16 20:04:08 +03:00
|
|
|
# The agent doesn't annotate Django management commands by default:
|
|
|
|
# https://docs.newrelic.com/docs/agents/python-agent/supported-features/python-background-tasks#django
|
|
|
|
# List finite-duration commands here to enable their annotation by the agent.
|
2019-03-04 19:10:58 +03:00
|
|
|
# For infinite duration commands (such as `pulse_listener_*`) see:
|
|
|
|
# https://docs.newrelic.com/docs/agents/python-agent/supported-features/python-background-tasks#wrapping
|
2018-11-28 01:14:38 +03:00
|
|
|
instrumentation.scripts.django_admin = check cycle_data load_initial_data migrate update_bugscache run_intermittents_commenter
|