Skip to content

Commit 561042d

Browse files
authored
Update jdbc doc with connection wrapping disclaimer (#14884)
1 parent a08a6b4 commit 561042d

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

docs/instrumentation-list.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5797,6 +5797,7 @@ libraries:
57975797
- name: jdbc
57985798
description: |
57995799
The JDBC instrumentation provides database client spans and metrics. Each call produces a span named after the SQL verb, enriched with standard DB client attributes (system, database, operation, sanitized statement, peer address) and error details if an exception occurs.
5800+
The instrumentation unwraps pooled connections (via java.sql.Wrapper) to cache database metadata against the underlying physical connection. Without proper unwrapping support, caching is limited to the wrapper instance, which typically changes each time a connection is retrieved from the pool. This can result in repeated metadata extraction, potentially causing performance degradation.
58005801
There is also a "jdbc-datasource" instrumentation that creates spans for datasource connections, but is disabled by default due to the volume of telemetry produced.
58015802
library_link: https://docs.oracle.com/javase/8/docs/api/java/sql/package-summary.html
58025803
source_path: instrumentation/jdbc

instrumentation/jdbc/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,12 @@
66
| `otel.instrumentation.jdbc.experimental.capture-query-parameters` | Boolean | `false` | Enable the capture of query parameters as span attributes. Enabling this option disables the statement sanitization. <p>WARNING: captured query parameters may contain sensitive information such as passwords, personally identifiable information or protected health info. |
77
| `otel.instrumentation.jdbc.experimental.transaction.enabled` | Boolean | `false` | Enables experimental instrumentation to create spans for COMMIT and ROLLBACK operations. |
88
| `otel.instrumentation.jdbc.experimental.sqlcommenter.enabled` | Boolean | `false` | Enables augmenting queries with a comment containing the tracing information. See [sqlcommenter](https://google.github.io/sqlcommenter/) for more info. WARNING: augmenting queries with tracing context will make query texts unique, which may have adverse impact on database performance. Consult with database experts before enabling. |
9+
10+
## Connection Pool Unwrapping
11+
12+
The instrumentation unwraps pooled connections (via java.sql.Wrapper) to cache database metadata
13+
against the underlying physical connection. Most connection pools support this by default.
14+
15+
In the case that a connection pool doesn't support this, caching is limited
16+
to the wrapper instance, which typically changes each time a connection is retrieved from the pool.
17+
This can result in repeated metadata extraction, potentially causing performance degradation.

instrumentation/jdbc/metadata.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@ description: >
22
The JDBC instrumentation provides database client spans and metrics. Each call produces a span
33
named after the SQL verb, enriched with standard DB client attributes (system, database,
44
operation, sanitized statement, peer address) and error details if an exception occurs.
5-
5+
6+
The instrumentation unwraps pooled connections (via java.sql.Wrapper) to cache database metadata
7+
against the underlying physical connection. Without proper unwrapping support, caching is limited
8+
to the wrapper instance, which typically changes each time a connection is retrieved from the pool.
9+
This can result in repeated metadata extraction, potentially causing performance degradation.
10+
611
There is also a "jdbc-datasource" instrumentation that creates spans for datasource connections,
712
but is disabled by default due to the volume of telemetry produced.
813
library_link: https://docs.oracle.com/javase/8/docs/api/java/sql/package-summary.html

0 commit comments

Comments
 (0)