Skip to content

Don't instrument jdbc wrapper classes #5012

@trask

Description

@trask

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

The jdbc instrumentation currently captures the outermost connection layer, which may be a wrapper, in which case the db.connection_string and derived db.system, net.peer.name, etc may be incorrect. See #4974 for more info.

Describe the solution you'd like
Only instrument the real underlying jdbc drivers, either via hard-coded list of jdbc driver classes to instrument (e.g. DataDog/dd-trace-java#2247 and subsequent follow-up PRs) or via hard-coded list of wrapper classes to exclude from instrumentation (e.g. #4974 (comment)).

Another option is to update the span attributes on the "top-most" jdbc span when we encounter a lower-level jdbc span, but this is not great from a sampling perspective (where we want the span attributes at span start), and has additional performance cost.

Additional context
Not instrumenting wrappers classes will have nice side-effect of improving performance (no need for nested checks).

Metadata

Metadata

Assignees

No one assigned

    Labels

    contribution welcomeRequest makes sense, maintainers probably won't have time, contribution would be welcomeenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions