Mark capture-query-parameters as experimental (#13850)

Co-authored-by: Lauri Tulmin <ltulmin@splunk.com>
This commit is contained in:
Trask Stalnaker 2025-05-15 06:09:08 -07:00 committed by GitHub
parent 01a1afeb44
commit 6f80481a2e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 12 additions and 11 deletions

View File

@ -1,7 +1,7 @@
# Settings for the JDBC instrumentation # Settings for the JDBC instrumentation
| System property | Type | Default | Description | | System property | Type | Default | Description |
|--------------------------------------------------------------|---------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |-------------------------------------------------------------------|---------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `otel.instrumentation.jdbc.statement-sanitizer.enabled` | Boolean | `true` | Enables the DB statement sanitization. | | `otel.instrumentation.jdbc.statement-sanitizer.enabled` | Boolean | `true` | Enables the DB statement sanitization. |
| `otel.instrumentation.jdbc.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. | | `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. |
| `otel.instrumentation.jdbc.experimental.transaction.enabled` | Boolean | `false` | Enables experimental instrumentation to create spans for COMMIT and ROLLBACK operations. | | `otel.instrumentation.jdbc.experimental.transaction.enabled` | Boolean | `false` | Enables experimental instrumentation to create spans for COMMIT and ROLLBACK operations. |

View File

@ -91,7 +91,7 @@ tasks {
filter { filter {
includeTestsMatching("PreparedStatementParametersTest") includeTestsMatching("PreparedStatementParametersTest")
} }
jvmArgs("-Dotel.instrumentation.jdbc.capture-query-parameters=true") jvmArgs("-Dotel.instrumentation.jdbc.experimental.capture-query-parameters=true")
} }
check { check {

View File

@ -35,7 +35,7 @@ public final class JdbcSingletons {
CAPTURE_QUERY_PARAMETERS = CAPTURE_QUERY_PARAMETERS =
AgentInstrumentationConfig.get() AgentInstrumentationConfig.get()
.getBoolean("otel.instrumentation.jdbc.capture-query-parameters", false); .getBoolean("otel.instrumentation.jdbc.experimental.capture-query-parameters", false);
STATEMENT_INSTRUMENTER = STATEMENT_INSTRUMENTER =
JdbcInstrumenterFactory.createStatementInstrumenter( JdbcInstrumenterFactory.createStatementInstrumenter(

View File

@ -34,7 +34,7 @@ public final class JdbcInstrumenterFactory {
public static boolean captureQueryParameters() { public static boolean captureQueryParameters() {
return ConfigPropertiesUtil.getBoolean( return ConfigPropertiesUtil.getBoolean(
"otel.instrumentation.jdbc.capture-query-parameters", false); "otel.instrumentation.jdbc.experimental.capture-query-parameters", false);
} }
public static Instrumenter<DbRequest, Void> createStatementInstrumenter( public static Instrumenter<DbRequest, Void> createStatementInstrumenter(

View File

@ -23,7 +23,7 @@ configurations:
description: Used to specify a mapping from host names or IP addresses to peer services. description: Used to specify a mapping from host names or IP addresses to peer services.
type: map type: map
default: "" default: ""
- name: otel.instrumentation.jdbc.capture-query-parameters - name: otel.instrumentation.jdbc.experimental.capture-query-parameters
description: > description: >
Sets whether the query parameters should be captured as span attributes named Sets whether the query parameters should be captured as span attributes named
<code>db.query.parameter.&lt;key&gt;</code>. Enabling this option disables the statement <code>db.query.parameter.&lt;key&gt;</code>. Enabling this option disables the statement

View File

@ -58,7 +58,8 @@ final class DataSourcePostProcessor implements BeanPostProcessor, Ordered {
.setCaptureQueryParameters( .setCaptureQueryParameters(
configPropertiesProvider configPropertiesProvider
.getObject() .getObject()
.getBoolean("otel.instrumentation.jdbc.capture-query-parameters", false)) .getBoolean(
"otel.instrumentation.jdbc.experimental.capture-query-parameters", false))
.setTransactionInstrumenterEnabled( .setTransactionInstrumenterEnabled(
configPropertiesProvider configPropertiesProvider
.getObject() .getObject()

View File

@ -352,7 +352,7 @@
"defaultValue": true "defaultValue": true
}, },
{ {
"name": "otel.instrumentation.jdbc.capture-query-parameters", "name": "otel.instrumentation.jdbc.experimental.capture-query-parameters",
"type": "java.lang.Boolean", "type": "java.lang.Boolean",
"description": "Sets whether the query parameters should be captured as span attributes named <code>db.query.parameter.&lt;key&gt;</code>. 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.", "description": "Sets whether the query parameters should be captured as span attributes named <code>db.query.parameter.&lt;key&gt;</code>. 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.",
"defaultValue": false "defaultValue": false