Skip to content

Instrumentation for JDBC transaction commits #10381

@zhenlin-pay2

Description

@zhenlin-pay2

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

For the database we are using in our application, SQL COMMIT commands can take as long as typical DML commands (SELECT, INSERT, UPDATE, DELETE) to execute, and in edge cases, even longer, so we need visibility into when and how long COMMIT commands are running, especially in individual traces but perhaps also in aggregate.

Describe the solution you'd like

We would like to have instrumentation for COMMIT of a similar nature to the instrumentation already provided for DML commands. For JDBC this entails adding instrumentation to the commit method of java.sql.Connection.

Describe alternatives you've considered

We tried adding java.sql.Connection[commit] to otel.instrumentation.methods.include but the results were unsatisfactory for our setup: there were two layers of proxy objects, so each COMMIT resulted in three (nested) spans in the trace.

Additional context

For symmetry, it might also be nice to have instrumentation for ROLLBACK (java.sql.Connection[rollback]) too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    contribution welcomeRequest makes sense, maintainers probably won't have time, contribution would be welcomeenhancementNew feature or requestneeds triageNew issue that requires triage

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions