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

Have instrumentation for ASGI middleware receive/send callbacks. #1673

Merged

Conversation

antonpirker
Copy link
Member

@antonpirker antonpirker commented Oct 11, 2022

To better visualize what is going on when ASGI middlewares are executed we added instrumentation for the receive and send callbacks.

FIxes #1664

Before it seemed that the db.redis span originated in the AsyncExitStackMiddleware:
Screenshot 2022-10-14 at 15 20 43

Now you see that the db.redis span actually originates in a send callback that is defined in MyCustomCounterMiddleware.__call__.<locals>.count_hits_to_url:
Screenshot 2022-10-14 at 15 17 01

@antonpirker antonpirker marked this pull request as ready for review October 11, 2022 13:34
@antonpirker antonpirker marked this pull request as draft October 11, 2022 13:41
@antonpirker antonpirker marked this pull request as ready for review October 12, 2022 11:18
Copy link
Member

@sl0thentr0py sl0thentr0py left a comment

Choose a reason for hiding this comment

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

one question, and

in cases like these where we add some feature, can you attach a testing screenshot so that somebody who looks at the PR from the changelog can see clearly what changed?

sentry_sdk/integrations/starlette.py Outdated Show resolved Hide resolved
@antonpirker
Copy link
Member Author

one question, and

in cases like these where we add some feature, can you attach a testing screenshot so that somebody who looks at the PR from the changelog can see clearly what changed?

Good idea!

@antonpirker antonpirker merged commit 7d004f0 into master Oct 17, 2022
@antonpirker antonpirker deleted the antonpirker/1664-fix-parent-span-in-fastapi-middleware branch October 17, 2022 14:42
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.

Set correct parent span in async environment
2 participants