Skip to content

Commit 0cfe778

Browse files
Update the OpenTelemetry SDK version to 1.41.0 (#11985)
Co-authored-by: Lauri Tulmin <[email protected]>
1 parent f74af54 commit 0cfe778

File tree

6 files changed

+31
-55
lines changed

6 files changed

+31
-55
lines changed

dependencyManagement/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ val dependencyVersions = hashMapOf<String, String>()
88
rootProject.extra["versions"] = dependencyVersions
99

1010
// this line is managed by .github/scripts/update-sdk-version.sh
11-
val otelSdkVersion = "1.40.0"
11+
val otelSdkVersion = "1.41.0"
1212
val otelContribVersion = "1.37.0-alpha"
1313
val otelSdkAlphaVersion = otelSdkVersion.replaceFirst("(-SNAPSHOT)?$".toRegex(), "-alpha$1")
1414

examples/distro/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ subprojects {
2727
ext {
2828
versions = [
2929
// this line is managed by .github/scripts/update-sdk-version.sh
30-
opentelemetrySdk : "1.40.0",
30+
opentelemetrySdk : "1.41.0",
3131

3232
// these lines are managed by .github/scripts/update-version.sh
3333
opentelemetryJavaagent : "2.7.0-SNAPSHOT",

examples/extension/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ version '1.0'
2323
ext {
2424
versions = [
2525
// this line is managed by .github/scripts/update-sdk-version.sh
26-
opentelemetrySdk : "1.40.0",
26+
opentelemetrySdk : "1.41.0",
2727

2828
// these lines are managed by .github/scripts/update-version.sh
2929
opentelemetryJavaagent : "2.7.0-SNAPSHOT",

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

+2-26
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66
package io.opentelemetry.instrumentation.api.instrumenter;
77

88
import com.google.errorprone.annotations.CanIgnoreReturnValue;
9+
import io.opentelemetry.api.internal.InstrumentationUtil;
910
import io.opentelemetry.api.trace.Span;
1011
import io.opentelemetry.api.trace.SpanKind;
1112
import io.opentelemetry.context.Context;
1213
import io.opentelemetry.instrumentation.api.internal.SpanKey;
13-
import java.lang.reflect.InvocationTargetException;
14-
import java.lang.reflect.Method;
1514
import java.util.Map;
1615
import java.util.Set;
1716

@@ -90,20 +89,9 @@ public boolean shouldSuppress(Context parentContext, SpanKind spanKind) {
9089

9190
static class ByContextKey implements SpanSuppressor {
9291
private final SpanSuppressor delegate;
93-
private final Method shouldSuppressInstrumentation;
9492

9593
ByContextKey(SpanSuppressor delegate) {
9694
this.delegate = delegate;
97-
Method shouldSuppressInstrumentation;
98-
try {
99-
Class<?> instrumentationUtil =
100-
Class.forName("io.opentelemetry.exporter.internal.InstrumentationUtil");
101-
shouldSuppressInstrumentation =
102-
instrumentationUtil.getDeclaredMethod("shouldSuppressInstrumentation", Context.class);
103-
} catch (ClassNotFoundException | NoSuchMethodException e) {
104-
shouldSuppressInstrumentation = null;
105-
}
106-
this.shouldSuppressInstrumentation = shouldSuppressInstrumentation;
10795
}
10896

10997
@Override
@@ -113,22 +101,10 @@ public Context storeInContext(Context context, SpanKind spanKind, Span span) {
113101

114102
@Override
115103
public boolean shouldSuppress(Context parentContext, SpanKind spanKind) {
116-
if (suppressByContextKey(parentContext)) {
104+
if (InstrumentationUtil.shouldSuppressInstrumentation(parentContext)) {
117105
return true;
118106
}
119107
return delegate.shouldSuppress(parentContext, spanKind);
120108
}
121-
122-
private boolean suppressByContextKey(Context context) {
123-
if (shouldSuppressInstrumentation == null) {
124-
return false;
125-
}
126-
127-
try {
128-
return (boolean) shouldSuppressInstrumentation.invoke(null, context);
129-
} catch (IllegalAccessException | InvocationTargetException e) {
130-
return false;
131-
}
132-
}
133109
}
134110
}

instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/SpanSuppressionStrategyTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
import static org.junit.jupiter.api.Assertions.assertSame;
1414
import static org.junit.jupiter.api.Assertions.assertTrue;
1515

16+
import io.opentelemetry.api.internal.InstrumentationUtil;
1617
import io.opentelemetry.api.trace.Span;
1718
import io.opentelemetry.api.trace.SpanKind;
1819
import io.opentelemetry.context.Context;
19-
import io.opentelemetry.exporter.internal.InstrumentationUtil;
2020
import io.opentelemetry.instrumentation.api.internal.SpanKey;
2121
import java.util.HashSet;
2222
import java.util.Set;

licenses/licenses.md

+25-25
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)