Closed gggritso closed 6 months ago
The attributes should be named after the otel semantic conventions for code: https://opentelemetry.io/docs/specs/semconv/attributes-registry/code/
@AbhiPrasad all of them? This would require some parsing logic, could we live with one combined attribute?
@gggritso @sentrivana can have a look at this starting with next week - please reach out to her directly if you want to discuss anything sooner
@AbhiPrasad all of them? This would require some parsing logic, could we live with one combined attribute?
Yeah a combined attribute is fine if we can't do the OTEL way in certain sdks/frameworks, we can even propose this upstream long term.
We'll stick with Otel, WIP for Laravel at https://github.com/getsentry/sentry-laravel/pull/803
It's shipped!
We'll open follow up issues for other SDKs in their respective repos - I'll also update develop to add query source as an expected feature of the sdks.
Description
People love the Starfish "Database" module, but everyone struggles to find the source of their SQL queries in their own codebase. We're hoping to attach the line of code that caused the query (AKA the "query source") to database spans. Laravel already does this, and it's invaluable! We'd love to see this in the Python and Ruby SDKs as well as a start.
The project document describes our idea in detail and addresses some likely objections. As a summary, here's what we're hoping for: For every query that takes longer than a threshold, attach the most recent in-app frame as a string property.
For example, with a threshold of 100ms, if a query takes 450ms, attach a property called
code_source
(name TBD) that shows where the query happened (e.g.,/app/Http/Controllers/UserController.php:21
)We are open to suggestions and happy to contribute to the project in any way that is valuable!
RFC
No response
Slack-Channel
discuss-starfish
Notion Document(s)
https://www.notion.so/sentry/Query-Source-c771873b972f4aac9504950f2f77741a?pvs=4
Stakeholder(s)
https://github.com/orgs/getsentry/teams/team-starfish
Team(s)
Web Backend