-
Notifications
You must be signed in to change notification settings - Fork 768
Fix for issue - #2808: Invalid type WSGIRequest for attribute 'request' value opentelemetry #3731
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
base: main
Are you sure you want to change the base?
Conversation
instrumentation/opentelemetry-instrumentation-django/tests/test_middleware.py
Outdated
Show resolved
Hide resolved
if hasattr(value, "__class__"): | ||
if value.__class__.__name__ in ( | ||
"HttpRequest", | ||
"WSGIRequest", | ||
): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this file is already doing from django.http import HttpRequest
, would it work if this check instead did isinstance(value, HttpRequest)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tammy-baylis-swi Sounds good. Thanks a lot for the review, I have addressed your feedback. Could you please take another look when you have a moment. Thanks!
...nstrumentation-django/src/opentelemetry/instrumentation/django/middleware/otel_middleware.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again @rads-1996 , this lgtm. Maintainers will also have a look.
Thank you so much. Really appreciate the review :) |
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes #2808
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.