|
5 | 5 |
|
6 | 6 | package io.opentelemetry.instrumentation.api.incubator.config.internal; |
7 | 7 |
|
8 | | -import static java.util.Collections.emptySet; |
9 | | - |
10 | 8 | import io.opentelemetry.api.OpenTelemetry; |
11 | 9 | import io.opentelemetry.api.incubator.config.DeclarativeConfigProperties; |
12 | 10 | import io.opentelemetry.instrumentation.api.incubator.log.LoggingContextConstants; |
|
15 | 13 | import java.util.HashSet; |
16 | 14 | import java.util.List; |
17 | 15 | import java.util.Set; |
18 | | -import java.util.logging.Logger; |
19 | 16 |
|
20 | 17 | /** |
21 | 18 | * This class is internal and is hence not for public use. Its APIs are unstable and can change at |
22 | 19 | * any time. |
23 | 20 | */ |
24 | 21 | public final class CommonConfig { |
25 | 22 |
|
26 | | - private static final Logger logger = Logger.getLogger(CommonConfig.class.getName()); |
27 | | - |
28 | 23 | private final List<String> clientRequestHeaders; |
29 | 24 | private final List<String> clientResponseHeaders; |
30 | 25 | private final List<String> serverRequestHeaders; |
@@ -77,26 +72,15 @@ public CommonConfig(OpenTelemetry openTelemetry) { |
77 | 72 | .get("client") |
78 | 73 | .getBoolean("emit_experimental_telemetry/development", false); |
79 | 74 |
|
80 | | - Boolean oldRedact = |
81 | | - commonConfig.get("http").get("client").getBoolean("redact_query_parameters/development"); |
82 | | - if (oldRedact != null) { |
83 | | - logger.warning( |
84 | | - "otel.instrumentation.http.client.experimental.redact-query-parameters is deprecated. " |
85 | | - + "Use otel.instrumentation.sanitization.url.experimental.sensitive-query-parameters instead."); |
86 | | - } |
87 | | - List<String> newConfigValue = |
| 75 | + List<String> sensitiveQueryParameterList = |
88 | 76 | generalConfig |
89 | 77 | .get("sanitization") |
90 | 78 | .get("url") |
91 | 79 | .getScalarList("sensitive_query_parameters/development", String.class); |
92 | | - |
93 | | - if (newConfigValue != null) { |
94 | | - sensitiveQueryParameters = new HashSet<>(newConfigValue); |
95 | | - } else if (oldRedact != null) { |
96 | | - sensitiveQueryParameters = oldRedact ? HttpConstants.SENSITIVE_QUERY_PARAMETERS : emptySet(); |
97 | | - } else { |
98 | | - sensitiveQueryParameters = HttpConstants.SENSITIVE_QUERY_PARAMETERS; |
99 | | - } |
| 80 | + sensitiveQueryParameters = |
| 81 | + sensitiveQueryParameterList != null |
| 82 | + ? new HashSet<>(sensitiveQueryParameterList) |
| 83 | + : HttpConstants.SENSITIVE_QUERY_PARAMETERS; |
100 | 84 |
|
101 | 85 | emitExperimentalHttpServerTelemetry = |
102 | 86 | commonConfig |
|
0 commit comments