-
Notifications
You must be signed in to change notification settings - Fork 626
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
Include sqlcomment in db.statement span attribute from SQLAlchemy instrumentation #2938
Comments
I don't understand this argument. The comment (e.g. I think this behaviour should be optional and off by default. It makes it much less efficient to store and query the |
Thanks for your input @alexmojaki ! It is indeed not needed for correlation. But it's convenient for some backends as a diagnostic containing the "true value" of a full query statement that was sent to a db server. I get the concern for db.statement uniqueness! In the short term, I'm working on making full sqlcomment inclusion in For longer term, we should generally update how the Python db client driver/ORM instrumentors are adhering to the db and mysql semconv. We currently have an open epic to migrate the most popular frameworks' instrumentors to the current semconv. Part of this is updating Regarding uniqueness, Regarding
I think this would be nice in addition to defining |
Yes it can be high cardinality, but the lower cardinality (without losing info like |
What problem do you want to solve?
SQLAlchemy instrumentation's opt-in sqlcommenting feature (doc) works to insert OTel context into MySQL or PostgreSQL general logs, e.g. this when used with mysql-connector driver:
For correlation of db queries to corresponding query spans, it would be convenient to also include the sqlcomment in the db.statement attribute of those spans, e.g.
Describe the solution you'd like
Include the sqlcomment in db.statement span attribute from SQLAlchemy instrumentation.
Describe alternatives you've considered
No response
Additional Context
Similar to #2936.
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: