Upgrade extensions to latest release
MODIFY
examples/extension/build.gradle
examples/extension/build.gradle
@@ -20,10 +20,10 @@ version '1.0'
ext {
versions = [
- opentelemetry : "1.3.0",
- opentelemetryAlpha : "1.3.0-alpha",
- opentelemetryJavaagent : "1.3.0",
- opentelemetryJavaagentAlpha: "1.3.0-alpha",
+ opentelemetry : "1.4.1",
+ opentelemetryAlpha : "1.4.1-alpha",
+ opentelemetryJavaagent : "1.4.0",
+ opentelemetryJavaagentAlpha: "1.4.0-alpha",
]
deps = [
@@ -53,7 +53,7 @@ dependencies {
runtime all necessary classes are provided by javaagent itself.
*/
compileOnly("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure:${versions.opentelemetryAlpha}")
- compileOnly("io.opentelemetry.javaagent:opentelemetry-javaagent-api:${versions.opentelemetryJavaagentAlpha}")
+ compileOnly("io.opentelemetry.javaagent:opentelemetry-javaagent-instrumentation-api:${versions.opentelemetryJavaagentAlpha}")
compileOnly("io.opentelemetry.javaagent:opentelemetry-javaagent-extension-api:${versions.opentelemetryJavaagentAlpha}")
//Provides @AutoService annotation that makes registration of our SPI implementations much easier

MODIFY
examples/extension/src/main/java/com/example/javaagent/DemoPropertySource.java
examples/extension/src/main/java/com/example/javaagent/DemoPropertySource.java
package com.example.javaagent;
import com.google.auto.service.AutoService;
-import io.opentelemetry.javaagent.spi.config.PropertySource;
+import io.opentelemetry.javaagent.extension.config.ConfigPropertySource;
import java.util.Map;
/**
- * {@link PropertySource} is an SPI provided by OpenTelemetry Java instrumentation agent.
+ * {@link ConfigPropertySource} is an SPI provided by OpenTelemetry Java instrumentation agent.
* By implementing it custom distributions can supply their own default configuration.
* The configuration priority, from highest to lowest is:
* system properties -> environment variables -> configuration file -> PropertySource SPI -> hard-coded defaults
*/
-@AutoService(PropertySource.class)
-public class DemoPropertySource implements PropertySource {
+@AutoService(ConfigPropertySource.class)
+public class DemoPropertySource implements ConfigPropertySource {
@Override
public Map<String, String> getProperties() {

MODIFY
examples/extension/src/main/java/com/example/javaagent/instrumentation/DemoServlet3Instrumentation.java
examples/extension/src/main/java/com/example/javaagent/instrumentation/DemoServlet3Instrumentation.java
@@ -17,7 +17,7 @@ import javax.servlet.http.HttpServletResponse;
public class DemoServlet3Instrumentation implements TypeInstrumentation {
@Override
public ElementMatcher<TypeDescription> typeMatcher() {
- return AgentElementMatchers.safeHasSuperType(
+ return AgentElementMatchers.hasSuperType(
namedOneOf("javax.servlet.Filter", "javax.servlet.http.HttpServlet"));
}

MODIFY
examples/extension/src/main/java/com/example/javaagent/instrumentation/DemoServlet3InstrumentationModule.java
examples/extension/src/main/java/com/example/javaagent/instrumentation/DemoServlet3InstrumentationModule.java
@@ -5,7 +5,7 @@ import static java.util.Collections.singletonList;
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.extension.matcher.AgentElementMatchers;
import java.util.List;
import net.bytebuddy.matcher.ElementMatcher;
@@ -31,7 +31,7 @@ public final class DemoServlet3InstrumentationModule extends InstrumentationModu
@Override
public ElementMatcher.Junction<ClassLoader> classLoaderMatcher() {
- return ClassLoaderMatcher.hasClassesNamed("javax.servlet.http.HttpServlet");
+ return AgentElementMatchers.hasClassesNamed("javax.servlet.http.HttpServlet");
}
@Override

Upgrade extensions to latest release (#3655)