Don't instrument jdbc wrapper classes #5012
Labels
contribution welcome
Request makes sense, maintainers probably won't have time, contribution would be welcome
enhancement
New feature or request
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 deriveddb.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).
The text was updated successfully, but these errors were encountered: