Propagate trace info to the database from SQL query text #11940
Labels
contribution welcome
Request makes sense, maintainers probably won't have time, contribution would be welcome
enhancement
New feature or request
Is your feature request related to a problem? Please describe.
When tracing an application and troubleshooting application issues, it is often useful to trace a SQL query from the application in the database logs. This allows you to move from a query to its plan and understand why the DBMS acts in this way in a particular case. Some cloud solutions allow such tracing to the database level, distributing the tracing context as a comment in the SQL query. It would be useful to implement similar functionality in Opentelemetry java agent JDBC
Describe the solution you'd like
When running my application with the opentelemetry agent and the agent option to tracing in the SQL text enabled (some new experimental option), I expect in the logs of my DBMS something similar to:
There is already an implementation of such functionality in the project
Describe alternatives you've considered
Save session information from JDBC Connection in tracing object io.opentelemetry.instrumentation.jdbc.internal.DbRequest
Additional context
No response
The text was updated successfully, but these errors were encountered: