-
Notifications
You must be signed in to change notification settings - Fork 514
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
Add query source to DB spans #2521
Conversation
Is it possible to tell what the overhead of this is going to be? |
Hard to tell. I am "only" walking the stack until i find the right frame and then add the data to the span. But maybe we should do some load testing. (it is opt-in, so we will not break anything out of the box) |
@AbhiPrasad Did some load testing on an FastAPI example app running 50 concurrent users doing around 85 requests per second: Without attaching the query source: With attaching the query source: The only difference I can see is the 99percentile is a bit slower with attaching query sources (but those are probably some outliers, the the max column) So I think we are good here. |
And here the event as JSON: python-with-query-source.json |
One thing to mention: When finding the right frame to attach as query source I am omitting external sources (stuff that is in This works well if someone has for example Django and does queries using Djangos ORM because the queries are done in the users code. But if they have Django and DjangoRestFramework the place in the users code that defines the query does not show up in the stack trace and I can not add the query source. Which is a bummer, but I think kind of ok, because if they have DjangoRestFramework the transaction name will lead them to their serializer and then they know where to look for the query/queries. |
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.
LGTM, left some suggestions
Pull Request is not mergeable
…y-python into antonpirker/query-source
Dogfooding the query source feature. Conservatively sets the threshold to 500ms for now. If you're wondering about performance overhead for this, check out info in getsentry/sentry-python#2521 --------- Co-authored-by: Anton Pirker <[email protected]>
Adding OTel compatible information to database spans that show the code location of the query.
Refs getsentry/team-sdks#40
This has to be
100ms
to runDocumentation PR: getsentry/sentry-docs#8558
In the product this will then be displayed with something like this: