You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After integrating the SQLAlchemy instrumentor, there are spans recorded for every single query being run which in some contexts generates a lot of noise and makes the spans difficult to follow.
For example, I'm working on a project where we group spans in the context of a job and some of these jobs run dozens of queries among other actions. As a result, when there are so many small events (we care only about slow queries) it's easy to miss an important one in between
Describe the solution you'd like
This can be solved by adding a configuration option such as exec_time_treshold which when set will only create spans for queries which take longer than that. For example, when exec_time_treshold=100 only queries which take longer than 100ms will create spans. For backwards compatibility (also a sane default) when not set all queries will create spans.
Describe alternatives you've considered
We've also investigated grouping queries done in the same transaction together (sample implementation bellow), so that we can at least collapse them. But in reality most of our transactions contain a single query and in these cases it doesn't help much.
Sample (and hacky) implementation of grouped queries by transaction
What problem do you want to solve?
After integrating the SQLAlchemy instrumentor, there are spans recorded for every single query being run which in some contexts generates a lot of noise and makes the spans difficult to follow.
For example, I'm working on a project where we group spans in the context of a job and some of these jobs run dozens of queries among other actions. As a result, when there are so many small events (we care only about slow queries) it's easy to miss an important one in between
Describe the solution you'd like
This can be solved by adding a configuration option such as
exec_time_treshold
which when set will only create spans for queries which take longer than that. For example, whenexec_time_treshold=100
only queries which take longer than 100ms will create spans. For backwards compatibility (also a sane default) when not set all queries will create spans.Describe alternatives you've considered
We've also investigated grouping queries done in the same transaction together (sample implementation bellow), so that we can at least collapse them. But in reality most of our transactions contain a single query and in these cases it doesn't help much.
Sample (and hacky) implementation of grouped queries by transaction
Additional Context
No response
Would you like to implement a fix?
Yes
The text was updated successfully, but these errors were encountered: