Update examples/distro to 1.2.0
MODIFY
examples/distro/build.gradle
examples/distro/build.gradle
@@ -8,8 +8,8 @@ subprojects {
ext {
versions = [
- opentelemetry : "1.0.0",
- opentelemetryJavaagent: "1.0.0",
+ opentelemetry : "1.2.0",
+ opentelemetryJavaagent: "1.2.0",
bytebuddy : "1.10.18",
guava : "30.1-jre"
]

MODIFY
examples/distro/custom/build.gradle
examples/distro/custom/build.gradle
@@ -10,7 +10,7 @@ def relocatePackages = ext.relocatePackages
dependencies {
compileOnly("io.opentelemetry:opentelemetry-sdk:${versions.opentelemetry}")
compileOnly("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure:${versions.opentelemetryAlpha}")
- compileOnly("io.opentelemetry.javaagent:opentelemetry-javaagent-spi:${versions.opentelemetryJavaagentAlpha}")
+ compileOnly("io.opentelemetry.javaagent:opentelemetry-javaagent-extension-api:${versions.opentelemetryJavaagentAlpha}")
}
tasks {

MODIFY
examples/distro/gradle/instrumentation.gradle
examples/distro/gradle/instrumentation.gradle
@@ -13,7 +13,7 @@ configurations {
dependencies {
compileOnly("io.opentelemetry:opentelemetry-sdk:${versions.opentelemetry}")
compileOnly("io.opentelemetry.javaagent:opentelemetry-javaagent-api:${versions.opentelemetryJavaagentAlpha}")
- compileOnly("io.opentelemetry.javaagent:opentelemetry-javaagent-tooling:${versions.opentelemetryJavaagentAlpha}")
+ compileOnly("io.opentelemetry.javaagent:opentelemetry-javaagent-extension-api:${versions.opentelemetryJavaagentAlpha}")
compileOnly deps.bytebuddy
compileOnly deps.bytebuddyagent

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.bytebuddy.matcher.NameMatchers.namedOneOf;
+import static io.opentelemetry.javaagent.extension.matcher.AgentElementMatchers.safeHasSuperType;
+import static io.opentelemetry.javaagent.extension.matcher.NameMatchers.namedOneOf;
import static java.util.Collections.singletonList;
import static java.util.Collections.singletonMap;
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
@@ -9,10 +9,10 @@ import static net.bytebuddy.matcher.ElementMatchers.named;
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
import com.google.auto.service.AutoService;
+import io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule;
+import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
+import io.opentelemetry.javaagent.extension.matcher.ClassLoaderMatcher;
import io.opentelemetry.javaagent.instrumentation.api.Java8BytecodeBridge;
-import io.opentelemetry.javaagent.tooling.InstrumentationModule;
-import io.opentelemetry.javaagent.tooling.TypeInstrumentation;
-import io.opentelemetry.javaagent.tooling.bytebuddy.matcher.ClassLoaderMatcher;
import java.util.List;
import java.util.Map;
import javax.servlet.ServletResponse;
@@ -38,7 +38,7 @@ public final class DemoServlet3InstrumentationModule extends InstrumentationModu
This instrumentation needs access to that server span.
*/
@Override
- public int getOrder() {
+ public int order() {
return 1;
}
@@ -65,7 +65,7 @@ public final class DemoServlet3InstrumentationModule extends InstrumentationModu
.and(takesArgument(0, named("javax.servlet.ServletRequest")))
.and(takesArgument(1, named("javax.servlet.ServletResponse")))
.and(isPublic()),
- DemoServlet3Advice.class.getName());
+ this.getClass().getName() + "$DemoServlet3Advice");
}
@SuppressWarnings("unused")

MODIFY
examples/distro/instrumentation/servlet-3/src/test/java/com/example/javaagent/instrumentation/DemoServlet3InstrumentationTest.java
examples/distro/instrumentation/servlet-3/src/test/java/com/example/javaagent/instrumentation/DemoServlet3InstrumentationTest.java
@@ -38,7 +38,7 @@ class DemoServlet3InstrumentationTest {
@BeforeAll
static void startServer() throws Exception {
- port = PortUtils.randomOpenPort();
+ port = PortUtils.findOpenPort();
server = new Server(port);
for (var connector : server.getConnectors()) {
connector.setHost("localhost");

Update examples/distro to 1.2.0 (#3020)