Skip to content

Commit

Permalink
Update the OpenTelemetry SDK version to 1.41.0 (#11985)
Browse files Browse the repository at this point in the history
Co-authored-by: Lauri Tulmin <[email protected]>
  • Loading branch information
opentelemetrybot and laurit authored Aug 13, 2024
1 parent f74af54 commit 0cfe778
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 55 deletions.
2 changes: 1 addition & 1 deletion dependencyManagement/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ val dependencyVersions = hashMapOf<String, String>()
rootProject.extra["versions"] = dependencyVersions

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

Expand Down
2 changes: 1 addition & 1 deletion examples/distro/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ subprojects {
ext {
versions = [
// this line is managed by .github/scripts/update-sdk-version.sh
opentelemetrySdk : "1.40.0",
opentelemetrySdk : "1.41.0",

// these lines are managed by .github/scripts/update-version.sh
opentelemetryJavaagent : "2.7.0-SNAPSHOT",
Expand Down
2 changes: 1 addition & 1 deletion examples/extension/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ version '1.0'
ext {
versions = [
// this line is managed by .github/scripts/update-sdk-version.sh
opentelemetrySdk : "1.40.0",
opentelemetrySdk : "1.41.0",

// these lines are managed by .github/scripts/update-version.sh
opentelemetryJavaagent : "2.7.0-SNAPSHOT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
package io.opentelemetry.instrumentation.api.instrumenter;

import com.google.errorprone.annotations.CanIgnoreReturnValue;
import io.opentelemetry.api.internal.InstrumentationUtil;
import io.opentelemetry.api.trace.Span;
import io.opentelemetry.api.trace.SpanKind;
import io.opentelemetry.context.Context;
import io.opentelemetry.instrumentation.api.internal.SpanKey;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Map;
import java.util.Set;

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

static class ByContextKey implements SpanSuppressor {
private final SpanSuppressor delegate;
private final Method shouldSuppressInstrumentation;

ByContextKey(SpanSuppressor delegate) {
this.delegate = delegate;
Method shouldSuppressInstrumentation;
try {
Class<?> instrumentationUtil =
Class.forName("io.opentelemetry.exporter.internal.InstrumentationUtil");
shouldSuppressInstrumentation =
instrumentationUtil.getDeclaredMethod("shouldSuppressInstrumentation", Context.class);
} catch (ClassNotFoundException | NoSuchMethodException e) {
shouldSuppressInstrumentation = null;
}
this.shouldSuppressInstrumentation = shouldSuppressInstrumentation;
}

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

@Override
public boolean shouldSuppress(Context parentContext, SpanKind spanKind) {
if (suppressByContextKey(parentContext)) {
if (InstrumentationUtil.shouldSuppressInstrumentation(parentContext)) {
return true;
}
return delegate.shouldSuppress(parentContext, spanKind);
}

private boolean suppressByContextKey(Context context) {
if (shouldSuppressInstrumentation == null) {
return false;
}

try {
return (boolean) shouldSuppressInstrumentation.invoke(null, context);
} catch (IllegalAccessException | InvocationTargetException e) {
return false;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertTrue;

import io.opentelemetry.api.internal.InstrumentationUtil;
import io.opentelemetry.api.trace.Span;
import io.opentelemetry.api.trace.SpanKind;
import io.opentelemetry.context.Context;
import io.opentelemetry.exporter.internal.InstrumentationUtil;
import io.opentelemetry.instrumentation.api.internal.SpanKey;
import java.util.HashSet;
import java.util.Set;
Expand Down
50 changes: 25 additions & 25 deletions licenses/licenses.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0cfe778

Please sign in to comment.