Skip to content

Allow JdbcTelemetry to rely on java opts #13870

Open
@AlixBa

Description

@AlixBa

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

// opts
-Dotel.instrumentation.jdbc.experimental.capture-query-parameters=true

// and somewhere in the code
JdbcTelemetry.create(otel).wrap(ds)

I think people will expect the opt to be enabled and get data in my spans. But as per the current implementation, JdbcTelemetryBuilder only relies on properties set explicitly such as builder.setCaptureQueryParameters(true).

I see that in OpenTelemetryDataSource there is a deprecated constructor relying on JdbcInstrumenterFactory which allows construction based on the opts. It has been deprecated with introduction of JdbcTelemetry andJdbcTelemetryBuilder.

Describe the solution you'd like

Would it be possible to provide something like JdbcTelemetry.autoConfigured(otel) for this use case or is it something that has been not allowed on purpose?

Describe alternatives you've considered

No response

Additional context

I'd be happy to implement it as soon as we have a solution!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestneeds triageNew issue that requires triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions