Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the OpenTelemetry SDK version to 1.41.0 #11985

Merged
merged 3 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading