-
Notifications
You must be signed in to change notification settings - Fork 743
Open
Labels
Description
What problem do you want to solve?
When using the AsyncPG instrumentation, spans are created with no attributes and the attributes are added immediately after by using span.set_attribute. This means samplers can't rely on request attributes which are known during span creation, and in practice have no way to sample any span.
Describe the solution you'd like
The attribute hydration function doesn't incur a meaningful performance penalty and can be used during span creation instead of within the span itself. This is also more correct for timing the actual request time.
Describe alternatives you've considered
There is no way to filter spans on specific tables or actions without relying on other logic such as some contextvar and code changes.
Additional Context
No response
Would you like to implement a fix?
None