-
Notifications
You must be signed in to change notification settings - Fork 993
Description
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).