The Python agent can now filter which Django middleware should be monitored. By default, all middleware will be instrumented.
Importante
Middleware Instrumentation Filtering for Django is available for Python agent version 10.17.0 and higher. By default, all middleware will be instrumented. To change this configuration, check out our documentation.
Disable all Django middleware
Disabling instrumentation of middleware in Django can be done one of two ways:
- Set the
NEW_RELIC_INSTRUMENTATION_DJANGO_MIDDLEWARE_ENABLED
environment variable toFalse
- Set
instrumentation.middleware.django.enabled = false
in the configuration file.
Django middleware configuration settings
Middleware exclude/include rules
The agent follows these rules when determining which middleware to include or exclude for monitoring: