Open igor-suhorukov opened 3 months ago
We'd welcome a contribution for this.
SQLCommenter was donated to OpenTelemetry but integration into the Java instrumentation project never happened: https://github.com/open-telemetry/opentelemetry-java-contrib/issues/205#issuecomment-1029306399
This would be very helpful, at a bare minimum if opentelemetry-sqlcommenter could be integrated as a package in opentelemetry-java-contrib like mentioned above.
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