Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(django): add config for instrumenting middleware #1384

Merged
merged 4 commits into from
Apr 30, 2020

Conversation

majorgreys
Copy link
Collaborator

@majorgreys majorgreys commented Apr 27, 2020

Resolves #1349

With middleware enabled (default behavior):

image

With middleware disabled (DD_DJANGO_INSTRUMENT_MIDDLEWARE=false):

image

@majorgreys majorgreys requested a review from a team as a code owner April 27, 2020 17:44
Copy link
Member

@brettlangdon brettlangdon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need tests?

@majorgreys
Copy link
Collaborator Author

majorgreys commented Apr 27, 2020

do we need tests?

ideally, yes, but the way we currently have django tests set up make adding ones for toggling this configuration option would require some big changes.

@majorgreys majorgreys closed this Apr 27, 2020
@majorgreys majorgreys reopened this Apr 27, 2020
@majorgreys majorgreys merged commit aa474ce into master Apr 30, 2020
@majorgreys majorgreys deleted the majorgreys/django-middleware-enable branch April 30, 2020 23:29
@Kyle-Verhoog Kyle-Verhoog added this to the 0.38.0 milestone May 12, 2020
@dmarkey
Copy link

dmarkey commented May 20, 2021

I've found that setting:

from ddtrace impoty config
config.django['instrument_middleware'] = False

Does not work, and I need to set DD_DJANGO_INSTRUMENT_MIDDLEWARE=False

Anyone know what I could be doing wrong?

@majorgreys
Copy link
Collaborator Author

@dmarkey Can you confirm that the ddtrace patching is occurring after or before you have set the config.django['instrument_middleware']?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New Django integration: opt-out of middleware instrumentation
4 participants