Skip to content

Commit 83f03ad

Browse files
Apply spotless formatting and finalize span-suppression-strategy rename
1 parent d844002 commit 83f03ad

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterBuilder.java

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,27 @@ public final class InstrumenterBuilder<REQUEST, RESPONSE> {
4949

5050
private static final Logger logger = Logger.getLogger(InstrumenterBuilder.class.getName());
5151

52-
private static final SpanSuppressionStrategy spanSuppressionStrategy =
53-
SpanSuppressionStrategy.fromConfig(
52+
private static final SpanSuppressionStrategy spanSuppressionStrategy;
53+
54+
static {
55+
String value =
56+
ConfigPropertiesUtil.getString(
57+
"otel.instrumentation.common.experimental.span-suppression-strategy");
58+
59+
if (value == null) {
60+
value =
5461
ConfigPropertiesUtil.getString(
55-
"otel.instrumentation.experimental.span-suppression-strategy"));
62+
"otel.instrumentation.experimental.span-suppression-strategy");
63+
64+
if (value != null) {
65+
logger.warning(
66+
"Using deprecated config: otel.instrumentation.experimental.span-suppression-strategy. "
67+
+ "Use otel.instrumentation.common.experimental.span-suppression-strategy instead.");
68+
}
69+
}
70+
71+
spanSuppressionStrategy = SpanSuppressionStrategy.fromConfig(value);
72+
}
5673

5774
final OpenTelemetry openTelemetry;
5875
final String instrumentationName;

instrumentation/camel-2.20/javaagent/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ tasks {
7474
jvmArgs("-Dotel.instrumentation.aws-sdk.experimental-span-attributes=true")
7575

7676
// TODO: fix camel instrumentation so that it uses semantic attributes extractors
77-
jvmArgs("-Dotel.instrumentation.experimental.span-suppression-strategy=span-kind")
77+
jvmArgs("-Dotel.instrumentation.common.experimental.span-suppression-strategy=span-kind")
7878

7979
// required on jdk17
8080
jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")

javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/AgentInstaller.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,8 @@ private static void installEarlyInstrumentation(
284284
}
285285

286286
private static void copyNecessaryConfigToSystemProperties(ConfigProperties config) {
287-
for (String property : asList("otel.instrumentation.experimental.span-suppression-strategy")) {
287+
for (String property :
288+
asList("otel.instrumentation.common.experimental.span-suppression-strategy")) {
288289
String value = config.getString(property);
289290
if (value != null) {
290291
System.setProperty(property, value);

0 commit comments

Comments
 (0)