diff --git a/build.gradle.kts b/build.gradle.kts index 8b5878178..43f545925 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -54,14 +54,14 @@ subprojects { extra.set("versions", mapOf( // when updating these values, some values must also be updated in buildSrc as this map // cannot be accessed there - "opentelemetry" to "1.24.0", - "opentelemetry_semconv" to "1.24.0-alpha", + "opentelemetry" to "1.32.0", + "opentelemetry_semconv" to "1.21.0-alpha", "opentelemetry_proto" to "0.11.0-alpha", - "opentelemetry_java_agent" to "1.24.0-alpha", - "opentelemetry_java_agent_all" to "1.24.0", - "opentelemetry_java_agent-tooling" to "1.24.0-alpha", + "opentelemetry_java_agent" to "1.32.0-alpha", + "opentelemetry_java_agent_all" to "1.32.0", + "opentelemetry_java_agent-tooling" to "1.32.0-alpha", - "opentelemetry_gradle_plugin" to "1.24.0-alpha", + "opentelemetry_gradle_plugin" to "1.32.0-alpha", "byte_buddy" to "1.12.10", "slf4j" to "2.0.7" )) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 684caa445..101f97bca 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -33,7 +33,7 @@ tasks { dependencies { compileOnly(gradleApi()) implementation(localGroovy()) - val otelInstrumentationVersion = "1.24.0-alpha" + val otelInstrumentationVersion = "1.32.0-alpha" implementation("io.opentelemetry.javaagent:opentelemetry-muzzle:$otelInstrumentationVersion") implementation("io.opentelemetry.instrumentation.muzzle-generation:io.opentelemetry.instrumentation.muzzle-generation.gradle.plugin:$otelInstrumentationVersion") implementation("io.opentelemetry.instrumentation.muzzle-check:io.opentelemetry.instrumentation.muzzle-check.gradle.plugin:$otelInstrumentationVersion") diff --git a/instrumentation/apache-httpasyncclient-4.1/build.gradle.kts b/instrumentation/apache-httpasyncclient-4.1/build.gradle.kts index 8b186e64b..978587e2b 100644 --- a/instrumentation/apache-httpasyncclient-4.1/build.gradle.kts +++ b/instrumentation/apache-httpasyncclient-4.1/build.gradle.kts @@ -33,7 +33,7 @@ dependencies { implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-apache-httpasyncclient-4.1:${versions["opentelemetry_java_agent"]}") testImplementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-apache-httpclient-4.0:${versions["opentelemetry_java_agent"]}") - testImplementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv:${versions["opentelemetry_semconv"]}") + testImplementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv:${versions["opentelemetry_java_agent"]}") library("org.apache.httpcomponents:httpasyncclient:4.1") testImplementation(testFixtures(project(":testing-common"))) } diff --git a/instrumentation/apache-httpclient-4.0/build.gradle.kts b/instrumentation/apache-httpclient-4.0/build.gradle.kts index d2045c18a..7fb66d4a2 100644 --- a/instrumentation/apache-httpclient-4.0/build.gradle.kts +++ b/instrumentation/apache-httpclient-4.0/build.gradle.kts @@ -45,5 +45,5 @@ dependencies { library("org.apache.httpcomponents:httpclient:4.0") testImplementation(testFixtures(project(":testing-common"))) - testImplementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv:${versions["opentelemetry_semconv"]}") + testImplementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv:${versions["opentelemetry_java_agent"]}") } diff --git a/instrumentation/jaxrs-client-2.0/build.gradle.kts b/instrumentation/jaxrs-client-2.0/build.gradle.kts index a0ffcda8d..42720d7ad 100644 --- a/instrumentation/jaxrs-client-2.0/build.gradle.kts +++ b/instrumentation/jaxrs-client-2.0/build.gradle.kts @@ -33,14 +33,14 @@ val versions: Map by extra dependencies { api(project(":instrumentation:java-streams")) - api("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-http-url-connection:1.24.0-alpha") + api("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-http-url-connection:${versions["opentelemetry_java_agent"]}") compileOnly("javax.ws.rs:javax.ws.rs-api:2.0.1") testImplementation(testFixtures(project(":testing-common"))) testImplementation("org.glassfish.jersey.core:jersey-client:2.27") testImplementation("org.glassfish.jersey.inject:jersey-hk2:2.27") - testImplementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv:${versions["opentelemetry_semconv"]}") + testImplementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv:${versions["opentelemetry_java_agent"]}") testImplementation(project(":instrumentation:apache-httpclient-4.0")) testImplementation(files(project(":instrumentation:apache-httpclient-4.0").dependencyProject.sourceSets.main.map { it.output })) diff --git a/instrumentation/micronaut-1.0/build.gradle.kts b/instrumentation/micronaut-1.0/build.gradle.kts index 266933290..f0058478c 100644 --- a/instrumentation/micronaut-1.0/build.gradle.kts +++ b/instrumentation/micronaut-1.0/build.gradle.kts @@ -19,7 +19,7 @@ dependencies { testImplementation("io.micronaut:micronaut-inject:${micronautVersion}") testImplementation("io.micronaut:micronaut-http-client:${micronautVersion}") testAnnotationProcessor("io.micronaut:micronaut-inject-java:${micronautVersion}") - testImplementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv:${versions["opentelemetry_semconv"]}") + testImplementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv:${versions["opentelemetry_java_agent"]}") testImplementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-netty-4.1:${versions["opentelemetry_java_agent"]}") } diff --git a/instrumentation/micronaut-3.0/build.gradle.kts b/instrumentation/micronaut-3.0/build.gradle.kts index de78133ea..8531df256 100644 --- a/instrumentation/micronaut-3.0/build.gradle.kts +++ b/instrumentation/micronaut-3.0/build.gradle.kts @@ -22,6 +22,6 @@ dependencies { testImplementation("io.micronaut.rxjava2:micronaut-rxjava2:1.1.0") testImplementation("io.micronaut.rxjava2:micronaut-rxjava2-http-server-netty:1.1.0") testImplementation("io.micronaut.rxjava2:micronaut-rxjava2-http-client:1.1.0") - testImplementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv:${versions["opentelemetry_semconv"]}") + testImplementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv:${versions["opentelemetry_java_agent"]}") testImplementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-netty-4.1:${versions["opentelemetry_java_agent"]}") } diff --git a/instrumentation/netty/netty-4.0/build.gradle.kts b/instrumentation/netty/netty-4.0/build.gradle.kts index f62ddb27d..a18459c96 100644 --- a/instrumentation/netty/netty-4.0/build.gradle.kts +++ b/instrumentation/netty/netty-4.0/build.gradle.kts @@ -49,8 +49,8 @@ dependencies { implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-netty-4.0:${versions["opentelemetry_java_agent"]}") implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-netty-4-common:${versions["opentelemetry_java_agent"]}") implementation("io.opentelemetry.instrumentation:opentelemetry-netty-4-common:${versions["opentelemetry_java_agent"]}") - implementation("io.opentelemetry:opentelemetry-semconv:${versions["opentelemetry_semconv"]}") - implementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv:${versions["opentelemetry_semconv"]}") + implementation("io.opentelemetry.semconv:opentelemetry-semconv:${versions["opentelemetry_semconv"]}") + implementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv:${versions["opentelemetry_java_agent"]}") compileOnly("io.netty:netty-codec-http:${nettyVersion}") { version { strictly(nettyVersion) diff --git a/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/javaagent/instrumentation/hypertrace/netty/v4_0/client/HttpClientResponseTracingHandler.java b/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/javaagent/instrumentation/hypertrace/netty/v4_0/client/HttpClientResponseTracingHandler.java index 354d9f649..438c1a46a 100644 --- a/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/javaagent/instrumentation/hypertrace/netty/v4_0/client/HttpClientResponseTracingHandler.java +++ b/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/javaagent/instrumentation/hypertrace/netty/v4_0/client/HttpClientResponseTracingHandler.java @@ -32,7 +32,7 @@ import io.opentelemetry.javaagent.instrumentation.hypertrace.netty.v4_0.AttributeKeys; import io.opentelemetry.javaagent.instrumentation.hypertrace.netty.v4_0.DataCaptureUtils; import io.opentelemetry.javaagent.instrumentation.netty.v4_0.client.NettyClientSingletons; -import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; +import io.opentelemetry.semconv.SemanticAttributes; import java.nio.charset.Charset; import java.util.Map; import org.hypertrace.agent.core.config.InstrumentationConfig; @@ -101,7 +101,7 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) { if (msg instanceof HttpResponse) { HttpResponse httpResponse = (HttpResponse) msg; int code = httpResponse.getStatus().code(); - span.setAttribute(SemanticAttributes.HTTP_STATUS_CODE, code); + span.setAttribute(SemanticAttributes.HTTP_RESPONSE_STATUS_CODE, code); span.setStatus(code >= 100 && code < 400 ? StatusCode.UNSET : StatusCode.ERROR); } if (msg instanceof LastHttpContent) { diff --git a/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/javaagent/instrumentation/hypertrace/netty/v4_0/server/HttpServerResponseTracingHandler.java b/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/javaagent/instrumentation/hypertrace/netty/v4_0/server/HttpServerResponseTracingHandler.java index 331979f28..0a83e153d 100644 --- a/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/javaagent/instrumentation/hypertrace/netty/v4_0/server/HttpServerResponseTracingHandler.java +++ b/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/javaagent/instrumentation/hypertrace/netty/v4_0/server/HttpServerResponseTracingHandler.java @@ -32,7 +32,7 @@ import io.opentelemetry.javaagent.instrumentation.hypertrace.netty.v4_0.AttributeKeys; import io.opentelemetry.javaagent.instrumentation.hypertrace.netty.v4_0.DataCaptureUtils; import io.opentelemetry.javaagent.instrumentation.netty.v4_0.server.NettyServerSingletons; -import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; +import io.opentelemetry.semconv.SemanticAttributes; import java.nio.charset.Charset; import java.util.Map; import org.hypertrace.agent.core.config.InstrumentationConfig; @@ -100,7 +100,7 @@ public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise prm) { if (msg instanceof HttpResponse) { HttpResponse httpResponse = (HttpResponse) msg; int code = httpResponse.getStatus().code(); - span.setAttribute(SemanticAttributes.HTTP_STATUS_CODE, code); + span.setAttribute(SemanticAttributes.HTTP_RESPONSE_STATUS_CODE, code); span.setStatus(code >= 100 && code < 500 ? StatusCode.UNSET : StatusCode.ERROR); } if (msg instanceof LastHttpContent) { diff --git a/instrumentation/netty/netty-4.1/build.gradle.kts b/instrumentation/netty/netty-4.1/build.gradle.kts index 50b12c314..54333b5a2 100644 --- a/instrumentation/netty/netty-4.1/build.gradle.kts +++ b/instrumentation/netty/netty-4.1/build.gradle.kts @@ -49,8 +49,8 @@ dependencies { implementation("io.opentelemetry.instrumentation:opentelemetry-netty-4-common:${versions["opentelemetry_java_agent"]}") implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-netty-4.1:${versions["opentelemetry_java_agent"]}") implementation("io.opentelemetry.instrumentation:opentelemetry-netty-4.1:${versions["opentelemetry_java_agent"]}") - implementation("io.opentelemetry:opentelemetry-semconv:${versions["opentelemetry_semconv"]}") - implementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv:${versions["opentelemetry_semconv"]}") + implementation("io.opentelemetry.semconv:opentelemetry-semconv:${versions["opentelemetry_semconv"]}") + implementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv:${versions["opentelemetry_java_agent"]}") library("io.netty:netty-codec-http:4.1.0.Final") testImplementation(testFixtures(project(":testing-common"))) diff --git a/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/javaagent/instrumentation/hypertrace/netty/v4_1/client/HttpClientResponseTracingHandler.java b/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/javaagent/instrumentation/hypertrace/netty/v4_1/client/HttpClientResponseTracingHandler.java index c056b47bf..6f31be4ca 100644 --- a/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/javaagent/instrumentation/hypertrace/netty/v4_1/client/HttpClientResponseTracingHandler.java +++ b/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/javaagent/instrumentation/hypertrace/netty/v4_1/client/HttpClientResponseTracingHandler.java @@ -32,7 +32,7 @@ import io.opentelemetry.javaagent.instrumentation.hypertrace.netty.v4_1.AttributeKeys; import io.opentelemetry.javaagent.instrumentation.hypertrace.netty.v4_1.DataCaptureUtils; import io.opentelemetry.javaagent.instrumentation.netty.v4_1.NettyClientSingletons; -import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; +import io.opentelemetry.semconv.SemanticAttributes; import java.nio.charset.Charset; import java.util.Map; import org.hypertrace.agent.core.config.InstrumentationConfig; @@ -100,7 +100,7 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) { if (msg instanceof HttpResponse) { HttpResponse httpResponse = (HttpResponse) msg; int code = httpResponse.status().code(); - span.setAttribute(SemanticAttributes.HTTP_STATUS_CODE, code); + span.setAttribute(SemanticAttributes.HTTP_RESPONSE_STATUS_CODE, code); span.setStatus(code >= 100 && code < 400 ? StatusCode.UNSET : StatusCode.ERROR); } if (msg instanceof LastHttpContent) { diff --git a/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/javaagent/instrumentation/hypertrace/netty/v4_1/server/HttpServerBlockingRequestHandler.java b/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/javaagent/instrumentation/hypertrace/netty/v4_1/server/HttpServerBlockingRequestHandler.java index c4bb452a2..38a145e1c 100644 --- a/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/javaagent/instrumentation/hypertrace/netty/v4_1/server/HttpServerBlockingRequestHandler.java +++ b/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/javaagent/instrumentation/hypertrace/netty/v4_1/server/HttpServerBlockingRequestHandler.java @@ -30,8 +30,10 @@ import io.opentelemetry.api.trace.Span; import io.opentelemetry.context.Context; import io.opentelemetry.instrumentation.netty.v4.common.HttpRequestAndChannel; +import io.opentelemetry.instrumentation.netty.v4_1.internal.ServerContext; import io.opentelemetry.javaagent.instrumentation.hypertrace.netty.v4_1.AttributeKeys; import java.nio.charset.StandardCharsets; +import java.util.Deque; import java.util.Map; import org.hypertrace.agent.core.filter.FilterResult; import org.hypertrace.agent.filter.FilterRegistry; @@ -41,10 +43,12 @@ public class HttpServerBlockingRequestHandler extends ChannelInboundHandlerAdapt @Override public void channelRead(ChannelHandlerContext ctx, Object msg) { Channel channel = ctx.channel(); - Context context = - channel + Deque serverContexts = + ctx.channel() .attr(io.opentelemetry.instrumentation.netty.v4_1.internal.AttributeKeys.SERVER_CONTEXT) .get(); + ServerContext serverContext = serverContexts != null ? serverContexts.peekFirst() : null; + Context context = serverContext != null ? serverContext.context() : null; if (context == null) { ctx.fireChannelRead(msg); return; diff --git a/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/javaagent/instrumentation/hypertrace/netty/v4_1/server/HttpServerRequestTracingHandler.java b/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/javaagent/instrumentation/hypertrace/netty/v4_1/server/HttpServerRequestTracingHandler.java index 30ba443c0..689cbabef 100644 --- a/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/javaagent/instrumentation/hypertrace/netty/v4_1/server/HttpServerRequestTracingHandler.java +++ b/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/javaagent/instrumentation/hypertrace/netty/v4_1/server/HttpServerRequestTracingHandler.java @@ -27,9 +27,11 @@ import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.api.trace.Span; import io.opentelemetry.context.Context; +import io.opentelemetry.instrumentation.netty.v4_1.internal.ServerContext; import io.opentelemetry.javaagent.instrumentation.hypertrace.netty.v4_1.AttributeKeys; import io.opentelemetry.javaagent.instrumentation.hypertrace.netty.v4_1.DataCaptureUtils; import java.nio.charset.Charset; +import java.util.Deque; import java.util.HashMap; import java.util.Map; import org.hypertrace.agent.core.config.InstrumentationConfig; @@ -48,10 +50,12 @@ public class HttpServerRequestTracingHandler extends ChannelInboundHandlerAdapte @Override public void channelRead(ChannelHandlerContext ctx, Object msg) { Channel channel = ctx.channel(); - Context context = - channel + Deque serverContexts = + ctx.channel() .attr(io.opentelemetry.instrumentation.netty.v4_1.internal.AttributeKeys.SERVER_CONTEXT) .get(); + ServerContext serverContext = serverContexts != null ? serverContexts.peekFirst() : null; + Context context = serverContext != null ? serverContext.context() : null; if (context == null) { ctx.fireChannelRead(msg); return; diff --git a/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/javaagent/instrumentation/hypertrace/netty/v4_1/server/HttpServerResponseTracingHandler.java b/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/javaagent/instrumentation/hypertrace/netty/v4_1/server/HttpServerResponseTracingHandler.java index f2831aa8f..965785d97 100644 --- a/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/javaagent/instrumentation/hypertrace/netty/v4_1/server/HttpServerResponseTracingHandler.java +++ b/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/javaagent/instrumentation/hypertrace/netty/v4_1/server/HttpServerResponseTracingHandler.java @@ -29,11 +29,13 @@ import io.opentelemetry.api.trace.StatusCode; import io.opentelemetry.context.Context; import io.opentelemetry.context.Scope; +import io.opentelemetry.instrumentation.netty.v4_1.internal.ServerContext; import io.opentelemetry.javaagent.instrumentation.hypertrace.netty.v4_1.AttributeKeys; import io.opentelemetry.javaagent.instrumentation.hypertrace.netty.v4_1.DataCaptureUtils; import io.opentelemetry.javaagent.instrumentation.netty.v4_1.NettyServerSingletons; -import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; +import io.opentelemetry.semconv.SemanticAttributes; import java.nio.charset.Charset; +import java.util.Deque; import java.util.Map; import org.hypertrace.agent.core.config.InstrumentationConfig; import org.hypertrace.agent.core.instrumentation.HypertraceSemanticAttributes; @@ -50,10 +52,13 @@ public class HttpServerResponseTracingHandler extends ChannelOutboundHandlerAdap @Override public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise prm) { - Context context = + Deque serverContexts = ctx.channel() .attr(io.opentelemetry.instrumentation.netty.v4_1.internal.AttributeKeys.SERVER_CONTEXT) .get(); + ServerContext serverContext = serverContexts != null ? serverContexts.peekFirst() : null; + Context context = serverContext != null ? serverContext.context() : null; + if (context == null) { ctx.write(msg, prm); return; @@ -99,7 +104,7 @@ public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise prm) { if (msg instanceof HttpResponse) { HttpResponse httpResponse = (HttpResponse) msg; int code = httpResponse.status().code(); - span.setAttribute(SemanticAttributes.HTTP_STATUS_CODE, code); + span.setAttribute(SemanticAttributes.HTTP_RESPONSE_STATUS_CODE, code); span.setStatus(code >= 100 && code < 500 ? StatusCode.UNSET : StatusCode.ERROR); } if (msg instanceof LastHttpContent) { diff --git a/instrumentation/servlet/servlet-3.0/build.gradle.kts b/instrumentation/servlet/servlet-3.0/build.gradle.kts index 31b407f11..b8b3d8d17 100644 --- a/instrumentation/servlet/servlet-3.0/build.gradle.kts +++ b/instrumentation/servlet/servlet-3.0/build.gradle.kts @@ -47,5 +47,5 @@ dependencies { } testImplementation("org.eclipse.jetty:jetty-server:8.1.22.v20160922") testImplementation("org.eclipse.jetty:jetty-servlet:8.1.22.v20160922") - testImplementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv:${versions["opentelemetry_semconv"]}") + testImplementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv:${versions["opentelemetry_java_agent"]}") } diff --git a/instrumentation/spark-2.3/build.gradle.kts b/instrumentation/spark-2.3/build.gradle.kts index 9561e42f6..5462544da 100644 --- a/instrumentation/spark-2.3/build.gradle.kts +++ b/instrumentation/spark-2.3/build.gradle.kts @@ -38,5 +38,5 @@ dependencies { testImplementation(files(project(":instrumentation:servlet:servlet-rw").dependencyProject.sourceSets.main.map { it.output })) testImplementation(testFixtures(project(":testing-common"))) testImplementation("com.sparkjava:spark-core:2.3") - testImplementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv:${versions["opentelemetry_semconv"]}") + testImplementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv:${versions["opentelemetry_java_agent"]}") } diff --git a/instrumentation/spring/spring-webflux-5.0/build.gradle.kts b/instrumentation/spring/spring-webflux-5.0/build.gradle.kts index e200a02cf..ab77eb7e6 100644 --- a/instrumentation/spring/spring-webflux-5.0/build.gradle.kts +++ b/instrumentation/spring/spring-webflux-5.0/build.gradle.kts @@ -24,5 +24,5 @@ dependencies { testImplementation("org.springframework.boot:spring-boot-starter-webflux:2.0.0.RELEASE") testImplementation("org.springframework.boot:spring-boot-starter-test:2.0.0.RELEASE") testImplementation("org.springframework.boot:spring-boot-starter-reactor-netty:2.0.0.RELEASE") - testImplementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv:${versions["opentelemetry_semconv"]}") + testImplementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv:${versions["opentelemetry_java_agent"]}") } diff --git a/instrumentation/struts-2.3/build.gradle.kts b/instrumentation/struts-2.3/build.gradle.kts index e72e7b3cf..5bd865e14 100644 --- a/instrumentation/struts-2.3/build.gradle.kts +++ b/instrumentation/struts-2.3/build.gradle.kts @@ -21,5 +21,5 @@ dependencies { testImplementation("org.eclipse.jetty:jetty-servlet:8.0.0.v20110901") testImplementation("javax.servlet:javax.servlet-api:3.0.1") testImplementation("javax.servlet:jsp-api:2.0") - testImplementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv:${versions["opentelemetry_semconv"]}") + testImplementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv:${versions["opentelemetry_java_agent"]}") } diff --git a/instrumentation/undertow/undertow-1.4/build.gradle.kts b/instrumentation/undertow/undertow-1.4/build.gradle.kts index 5234c9c0e..16caf12ca 100644 --- a/instrumentation/undertow/undertow-1.4/build.gradle.kts +++ b/instrumentation/undertow/undertow-1.4/build.gradle.kts @@ -32,7 +32,7 @@ dependencies { testImplementation(testFixtures(project(":testing-common"))) testImplementation("javax.servlet:javax.servlet-api:3.1.0") testImplementation("io.undertow:undertow-servlet:2.0.0.Final") - testImplementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv:${versions["opentelemetry_semconv"]}") + testImplementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv:${versions["opentelemetry_java_agent"]}") testRuntimeOnly(project(":instrumentation:servlet:servlet-3.0")) testRuntimeOnly(project(":instrumentation:undertow:undertow-servlet-1.4")) testRuntimeOnly("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-servlet-common-bootstrap:${versions["opentelemetry_java_agent"]}") diff --git a/otel-extensions/build.gradle.kts b/otel-extensions/build.gradle.kts index a752d48cb..e0a3bcc3b 100644 --- a/otel-extensions/build.gradle.kts +++ b/otel-extensions/build.gradle.kts @@ -30,10 +30,10 @@ dependencies { api(project(":filter-api")) compileOnly("io.opentelemetry:opentelemetry-sdk:${versions["opentelemetry"]}") - compileOnly("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure:${versions["opentelemetry"]}-alpha") + compileOnly("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure:${versions["opentelemetry"]}") compileOnly("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi:${versions["opentelemetry"]}") - implementation("io.opentelemetry:opentelemetry-semconv:${versions["opentelemetry"]}-alpha") + implementation("io.opentelemetry.semconv:opentelemetry-semconv:${versions["opentelemetry_semconv"]}") implementation("io.opentelemetry.javaagent:opentelemetry-javaagent-extension-api:${versions["opentelemetry_java_agent"]}") implementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api:${versions["opentelemetry"]}") implementation("io.opentelemetry.javaagent:opentelemetry-javaagent-tooling:${versions["opentelemetry_java_agent-tooling"]}") { @@ -65,6 +65,6 @@ dependencies { api("com.google.code.gson:gson:2.8.9") } - testImplementation("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure:${versions["opentelemetry"]}-alpha") + testImplementation("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure:${versions["opentelemetry"]}") testImplementation("io.opentelemetry:opentelemetry-sdk:${versions["opentelemetry"]}") } diff --git a/otel-extensions/src/main/java/org/hypertrace/agent/otel/extensions/HypertraceResourceProvider.java b/otel-extensions/src/main/java/org/hypertrace/agent/otel/extensions/HypertraceResourceProvider.java index cbb81cd2e..b92f12691 100644 --- a/otel-extensions/src/main/java/org/hypertrace/agent/otel/extensions/HypertraceResourceProvider.java +++ b/otel-extensions/src/main/java/org/hypertrace/agent/otel/extensions/HypertraceResourceProvider.java @@ -22,7 +22,7 @@ import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties; import io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider; import io.opentelemetry.sdk.resources.Resource; -import io.opentelemetry.semconv.resource.attributes.ResourceAttributes; +import io.opentelemetry.semconv.ResourceAttributes; import org.hypertrace.agent.config.v1.Config.AgentConfig; import org.hypertrace.agent.otel.extensions.config.HypertraceConfig; import org.slf4j.Logger; diff --git a/otel-extensions/src/main/java/org/hypertrace/agent/otel/extensions/processor/AddTagsSpanProcessor.java b/otel-extensions/src/main/java/org/hypertrace/agent/otel/extensions/processor/AddTagsSpanProcessor.java index 06356b6ee..175598d06 100644 --- a/otel-extensions/src/main/java/org/hypertrace/agent/otel/extensions/processor/AddTagsSpanProcessor.java +++ b/otel-extensions/src/main/java/org/hypertrace/agent/otel/extensions/processor/AddTagsSpanProcessor.java @@ -21,7 +21,7 @@ import io.opentelemetry.sdk.trace.ReadWriteSpan; import io.opentelemetry.sdk.trace.ReadableSpan; import io.opentelemetry.sdk.trace.SpanProcessor; -import io.opentelemetry.semconv.resource.attributes.ResourceAttributes; +import io.opentelemetry.semconv.ResourceAttributes; import org.hypertrace.agent.otel.extensions.CgroupsReader; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/smoke-tests/build.gradle.kts b/smoke-tests/build.gradle.kts index 6de59095c..b86e20986 100644 --- a/smoke-tests/build.gradle.kts +++ b/smoke-tests/build.gradle.kts @@ -26,7 +26,7 @@ dependencies{ testImplementation("info.solidsoft.spock:spock-global-unroll:0.5.1") testImplementation("com.fasterxml.jackson.core:jackson-databind:2.16.0") testImplementation("org.codehaus.groovy:groovy-all:2.5.11") - testImplementation("io.opentelemetry:opentelemetry-semconv:${versions["opentelemetry"]}-alpha") + testImplementation("io.opentelemetry.semconv:opentelemetry-semconv:${versions["opentelemetry_semconv"]}") } tasks.test { diff --git a/smoke-tests/src/test/java/org/hypertrace/agent/smoketest/SpringBootSmokeTest.java b/smoke-tests/src/test/java/org/hypertrace/agent/smoketest/SpringBootSmokeTest.java index da19ca902..3c9b90b67 100644 --- a/smoke-tests/src/test/java/org/hypertrace/agent/smoketest/SpringBootSmokeTest.java +++ b/smoke-tests/src/test/java/org/hypertrace/agent/smoketest/SpringBootSmokeTest.java @@ -18,7 +18,7 @@ import io.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest; import io.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest; -import io.opentelemetry.semconv.resource.attributes.ResourceAttributes; +import io.opentelemetry.semconv.ResourceAttributes; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; diff --git a/testing-common/build.gradle.kts b/testing-common/build.gradle.kts index a1ccb996c..fc173c4cd 100644 --- a/testing-common/build.gradle.kts +++ b/testing-common/build.gradle.kts @@ -14,7 +14,7 @@ dependencies { testFixturesImplementation("org.junit-pioneer:junit-pioneer:1.0.0") testFixturesApi("io.opentelemetry:opentelemetry-api:${versions["opentelemetry"]}") testFixturesApi("io.opentelemetry:opentelemetry-sdk:${versions["opentelemetry"]}") - testFixturesCompileOnly("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure:${versions["opentelemetry"]}-alpha") + testFixturesCompileOnly("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure:${versions["opentelemetry"]}") testFixturesApi("com.squareup.okhttp3:okhttp:4.9.0") testFixturesApi("com.squareup.okhttp3:logging-interceptor:4.9.0") testFixturesImplementation("io.opentelemetry:opentelemetry-exporter-logging:${versions["opentelemetry"]}") diff --git a/testing-common/src/testFixtures/java/org/hypertrace/agent/testing/AbstractInstrumenterTest.java b/testing-common/src/testFixtures/java/org/hypertrace/agent/testing/AbstractInstrumenterTest.java index bb3cfefb5..67fdffdf3 100644 --- a/testing-common/src/testFixtures/java/org/hypertrace/agent/testing/AbstractInstrumenterTest.java +++ b/testing-common/src/testFixtures/java/org/hypertrace/agent/testing/AbstractInstrumenterTest.java @@ -23,6 +23,7 @@ import io.opentelemetry.javaagent.bootstrap.AgentInitializer; import io.opentelemetry.javaagent.bootstrap.InstrumentationHolder; import io.opentelemetry.javaagent.tooling.AgentInstaller; +import io.opentelemetry.javaagent.tooling.config.EarlyInitAgentConfig; import java.io.IOException; import java.lang.instrument.Instrumentation; import java.lang.reflect.Field; @@ -115,7 +116,9 @@ public static void beforeAll() { // --------------------------------------------------------------------- System.setProperty("otel.instrumentation.internal-reflection.enabled", "false"); AgentInstaller.installBytebuddyAgent( - INSTRUMENTATION, AgentInitializer.getExtensionsClassLoader()); + INSTRUMENTATION, + AgentInitializer.getExtensionsClassLoader(), + EarlyInitAgentConfig.create()); INSTRUMENTED = true; } if (TEST_TRACER == null) {