Skip to content

Commit 6f80481

Browse files
trasklaurit
andauthored
Mark capture-query-parameters as experimental (#13850)
Co-authored-by: Lauri Tulmin <[email protected]>
1 parent 01a1afe commit 6f80481

File tree

7 files changed

+12
-11
lines changed

7 files changed

+12
-11
lines changed

instrumentation/jdbc/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Settings for the JDBC instrumentation
22

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

instrumentation/jdbc/javaagent/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ tasks {
9191
filter {
9292
includeTestsMatching("PreparedStatementParametersTest")
9393
}
94-
jvmArgs("-Dotel.instrumentation.jdbc.capture-query-parameters=true")
94+
jvmArgs("-Dotel.instrumentation.jdbc.experimental.capture-query-parameters=true")
9595
}
9696

9797
check {

instrumentation/jdbc/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jdbc/JdbcSingletons.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public final class JdbcSingletons {
3535

3636
CAPTURE_QUERY_PARAMETERS =
3737
AgentInstrumentationConfig.get()
38-
.getBoolean("otel.instrumentation.jdbc.capture-query-parameters", false);
38+
.getBoolean("otel.instrumentation.jdbc.experimental.capture-query-parameters", false);
3939

4040
STATEMENT_INSTRUMENTER =
4141
JdbcInstrumenterFactory.createStatementInstrumenter(

instrumentation/jdbc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/internal/JdbcInstrumenterFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public final class JdbcInstrumenterFactory {
3434

3535
public static boolean captureQueryParameters() {
3636
return ConfigPropertiesUtil.getBoolean(
37-
"otel.instrumentation.jdbc.capture-query-parameters", false);
37+
"otel.instrumentation.jdbc.experimental.capture-query-parameters", false);
3838
}
3939

4040
public static Instrumenter<DbRequest, Void> createStatementInstrumenter(

instrumentation/jdbc/metadata.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ configurations:
2323
description: Used to specify a mapping from host names or IP addresses to peer services.
2424
type: map
2525
default: ""
26-
- name: otel.instrumentation.jdbc.capture-query-parameters
26+
- name: otel.instrumentation.jdbc.experimental.capture-query-parameters
2727
description: >
2828
Sets whether the query parameters should be captured as span attributes named
2929
<code>db.query.parameter.&lt;key&gt;</code>. Enabling this option disables the statement

instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/internal/instrumentation/jdbc/DataSourcePostProcessor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ public Object postProcessAfterInitialization(Object bean, String beanName) {
5858
.setCaptureQueryParameters(
5959
configPropertiesProvider
6060
.getObject()
61-
.getBoolean("otel.instrumentation.jdbc.capture-query-parameters", false))
61+
.getBoolean(
62+
"otel.instrumentation.jdbc.experimental.capture-query-parameters", false))
6263
.setTransactionInstrumenterEnabled(
6364
configPropertiesProvider
6465
.getObject()

instrumentation/spring/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@
352352
"defaultValue": true
353353
},
354354
{
355-
"name": "otel.instrumentation.jdbc.capture-query-parameters",
355+
"name": "otel.instrumentation.jdbc.experimental.capture-query-parameters",
356356
"type": "java.lang.Boolean",
357357
"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.",
358358
"defaultValue": false

0 commit comments

Comments
 (0)