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

MODIFY
examples/distro/instrumentation/servlet-3/src/main/java/com/example/javaagent/instrumentation/DemoServlet3Instrumentation.java
examples/distro/instrumentation/servlet-3/src/main/java/com/example/javaagent/instrumentation/DemoServlet3Instrumentation.java
package com.example.javaagent.instrumentation;
+import static io.opentelemetry.javaagent.extension.matcher.AgentElementMatchers.safeHasSuperType;
+import static net.bytebuddy.matcher.ElementMatchers.isPublic;
+import static net.bytebuddy.matcher.ElementMatchers.named;
+import static net.bytebuddy.matcher.ElementMatchers.namedOneOf;
+import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
+
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
+import io.opentelemetry.javaagent.extension.instrumentation.TypeTransformer;
import io.opentelemetry.javaagent.instrumentation.api.Java8BytecodeBridge;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletResponse;
import net.bytebuddy.asm.Advice;
-import net.bytebuddy.description.method.MethodDescription;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.matcher.ElementMatcher;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletResponse;
-import java.util.Map;
-
-import static io.opentelemetry.javaagent.extension.matcher.AgentElementMatchers.safeHasSuperType;
-import static io.opentelemetry.javaagent.extension.matcher.NameMatchers.namedOneOf;
-import static java.util.Collections.singletonMap;
-import static net.bytebuddy.matcher.ElementMatchers.*;
-
public class DemoServlet3Instrumentation implements TypeInstrumentation {
@Override
public ElementMatcher<TypeDescription> typeMatcher() {
@@ -23,9 +22,8 @@ public class DemoServlet3Instrumentation implements TypeInstrumentation {
}
@Override
- public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
- return singletonMap(
- namedOneOf("doFilter", "service")
+ public void transform(TypeTransformer transformer) {
+ transformer.applyAdviceToMethod(namedOneOf("doFilter", "service")
.and(takesArgument(0, named("javax.servlet.ServletRequest")))
.and(takesArgument(1, named("javax.servlet.ServletResponse")))
.and(isPublic()),

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.extension.matcher.NameMatchers.namedOneOf;
import static java.util.Collections.singletonList;
-import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
import com.google.auto.service.AutoService;
import io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule;

MODIFY
examples/extension/build.gradle
examples/extension/build.gradle
@@ -18,10 +18,10 @@ version '1.0'
ext {
versions = [
- opentelemetry : "1.2.0",
- opentelemetryAlpha : "1.2.0-alpha",
- opentelemetryJavaagent : "1.3.0-SNAPSHOT",
- opentelemetryJavaagentAlpha: "1.3.0-alpha-SNAPSHOT",
+ opentelemetry : "1.3.0",
+ opentelemetryAlpha : "1.3.0-alpha",
+ opentelemetryJavaagent : "1.3.0",
+ opentelemetryJavaagentAlpha: "1.3.0-alpha",
]
deps = [
@@ -30,7 +30,6 @@ ext {
}
repositories {
- mavenLocal()
mavenCentral()
maven {
url = uri("https://oss.sonatype.org/content/repositories/snapshots")

Update distro and extension examples to 1.3.0 (#3355)