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
SentryWrappingMiddleware does not expose details of wrapped middleware #1145
Comments
I have faced the same issue 👀 |
@MattFisher thanks for the awesome issue! |
Include __name__, __module__, __qualname__, __doc__, __annotations__ Addresses getsentry#1145
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you label it "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
We have same problem. Is there any plan for fixing it? |
fixed by #1202, will be in next release |
Environment
How do you use Sentry?
Sentry SaaS (sentry.io)
Which SDK and version?
Python
sentry-sdk==1.1.0
Steps to Reproduce
Use the python sentry sdk alongside the python NewRelic agent (newrelic-python-agent v6.4.4.161).
Wait for slow transaction traces to appear in NewRelic UI.
Expected Result
The middleware entries in transaction traces should show the names of the middlewares being wrapped.
Actual Result
All middlewares in transaction traces appear listed as
sentry_sdk.integrations.django_middleware:_wrap_middleware.<locals>.SentryWrappingMiddleware
, as shown in the screenshot below.I've done some investigation, and the NewRelic agent determines the strings to be displayed
via a
callable_name
function, that bottoms out in a function called _object_context_py3. This function returns the module name (viaobject.__module__
) andobject.__qualname__
attributes of the passed object.In the
sentry_sdk.integrations.django.middleware._wrap_middleware
function, theSentryWrappingMiddleware
is given the wrapped middleware's__name__
attribute.In the standard library's
functools.wraps()
, the wrapping entity is given('__module__', '__name__', '__qualname__', '__doc__', '__annotations__')
of the wrapped object. This implies it should be pretty safe to do the same withSentryWrappingMiddleware
, like so:or potentially
After manually making the first code change listed above, the results were what was expected:
The text was updated successfully, but these errors were encountered: