opentelemetry-java-instrumentation icon indicating copy to clipboard operation
opentelemetry-java-instrumentation copied to clipboard

Save session information from JDBC Connection in object DbRequest to correlate RDBMS logs with opentelemetry tracing

Open igor-suhorukov opened this issue 1 year ago • 0 comments

Is your feature request related to a problem? Please describe.

When investigating incidents in an application for correlating RDBMS logs with OpenTelemetry tracing, it would be convenient to have information about the database session in the trace. In the case of PostgreSQL this is the backend PID.

Describe the solution you'd like

I expect a db.session field in io.opentelemetry.instrumentation.jdbc.internal.DbRequest that is populated from the database connection

Describe alternatives you've considered

No response

Additional context

For PostgreSQL it is possible to get PID form Connection object without any additional network request with

((PgConnection) connection).getBackendPID()

igor-suhorukov avatar Aug 03 '24 05:08 igor-suhorukov