updates the examples to use latest otel
MODIFY
examples/distro/build.gradle
examples/distro/build.gradle
@@ -8,8 +8,8 @@ subprojects {
ext {
versions = [
- opentelemetry : "0.13.1",
- opentelemetryJavaagent : "0.13.0",
+ opentelemetry : "0.14.1",
+ opentelemetryJavaagent : "0.14.0",
bytebuddy : "1.10.10",
guava : "30.1-jre"

MODIFY
examples/distro/custom/src/main/java/com/example/javaagent/DemoSampler.java
examples/distro/custom/src/main/java/com/example/javaagent/DemoSampler.java
@@ -3,6 +3,7 @@ package com.example.javaagent;
import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.api.trace.Span;
import io.opentelemetry.context.Context;
+import io.opentelemetry.sdk.trace.data.LinkData;
import io.opentelemetry.sdk.trace.data.SpanData;
import io.opentelemetry.sdk.trace.samplers.Sampler;
import io.opentelemetry.sdk.trace.samplers.SamplingResult;
@@ -19,7 +20,7 @@ import java.util.List;
public class DemoSampler implements Sampler {
@Override
public SamplingResult shouldSample(Context parentContext, String traceId, String name,
- Span.Kind spanKind, Attributes attributes, List<SpanData.Link> parentLinks) {
+ Span.Kind spanKind, Attributes attributes, List<LinkData> parentLinks) {
if (spanKind == Span.Kind.INTERNAL && name.contains("greeting")) {
return SamplingResult.create(SamplingResult.Decision.DROP);
} else {

MODIFY
examples/distro/instrumentation/servlet-3/src/main/java/com/example/javaagent/instrumentation/DemoServlet3InstrumentationModule.java
examples/distro/instrumentation/servlet-3/src/main/java/com/example/javaagent/instrumentation/DemoServlet3InstrumentationModule.java
package com.example.javaagent.instrumentation;
import static io.opentelemetry.javaagent.tooling.bytebuddy.matcher.AgentElementMatchers.safeHasSuperType;
-import static io.opentelemetry.javaagent.tooling.matcher.NameMatchers.namedOneOf;
+import static io.opentelemetry.javaagent.tooling.bytebuddy.matcher.NameMatchers.namedOneOf;
import static java.util.Collections.singletonList;
import static java.util.Collections.singletonMap;
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
@@ -10,13 +10,13 @@ import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
import com.google.auto.service.AutoService;
import io.opentelemetry.api.trace.Span;
-import io.opentelemetry.javaagent.tooling.ClassLoaderMatcher;
import io.opentelemetry.javaagent.tooling.InstrumentationModule;
import io.opentelemetry.javaagent.tooling.TypeInstrumentation;
import java.util.List;
import java.util.Map;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletResponse;
+import io.opentelemetry.javaagent.tooling.bytebuddy.matcher.ClassLoaderMatcher;
import net.bytebuddy.asm.Advice;
import net.bytebuddy.description.method.MethodDescription;
import net.bytebuddy.description.type.TypeDescription;

updates the examples to use latest otel (#2081)