Skip to content

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

Open
@igor-suhorukov

Description

@igor-suhorukov

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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions