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

View File

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

View File

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

View File

@ -34,7 +34,7 @@ public final class JdbcInstrumenterFactory {
public static boolean captureQueryParameters() {
return ConfigPropertiesUtil.getBoolean(
"otel.instrumentation.jdbc.capture-query-parameters", false);
"otel.instrumentation.jdbc.experimental.capture-query-parameters", false);
}
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.
type: map
default: ""
- name: otel.instrumentation.jdbc.capture-query-parameters
- name: otel.instrumentation.jdbc.experimental.capture-query-parameters
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

View File

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

View File

@ -352,7 +352,7 @@
"defaultValue": true
},
{
"name": "otel.instrumentation.jdbc.capture-query-parameters",
"name": "otel.instrumentation.jdbc.experimental.capture-query-parameters",
"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.",
"defaultValue": false