From 943580deddb4a22e102ff721e0fd545df3d18269 Mon Sep 17 00:00:00 2001 From: otelbot <197425009+otelbot@users.noreply.github.com> Date: Thu, 30 Apr 2026 07:18:10 +0000 Subject: [PATCH 1/9] Review fixes for internal-lambda:javaagent Automated code review of instrumentation/internal/internal-lambda/javaagent. --- .../internal/internal-lambda/javaagent/build.gradle.kts | 2 -- 1 file changed, 2 deletions(-) diff --git a/instrumentation/internal/internal-lambda/javaagent/build.gradle.kts b/instrumentation/internal/internal-lambda/javaagent/build.gradle.kts index 70f921cc7802..ffc36fce5908 100644 --- a/instrumentation/internal/internal-lambda/javaagent/build.gradle.kts +++ b/instrumentation/internal/internal-lambda/javaagent/build.gradle.kts @@ -3,7 +3,5 @@ plugins { } dependencies { - compileOnly(project(":javaagent-bootstrap")) - testImplementation(project(":javaagent-bootstrap")) } From 3bec20705a513ed56dbb27cfc36a5f942d726b60 Mon Sep 17 00:00:00 2001 From: otelbot <197425009+otelbot@users.noreply.github.com> Date: Thu, 30 Apr 2026 07:22:54 +0000 Subject: [PATCH 2/9] Review fixes for internal-reflection:javaagent-integration-tests Automated code review of instrumentation/internal/internal-reflection/javaagent-integration-tests. --- .../instrumentation/internal/reflection/ReflectionTest.java | 2 +- .../instrumentation/internal/reflection/TestClass.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/instrumentation/internal/internal-reflection/javaagent-integration-tests/src/test/java/io/opentelemetry/javaagent/instrumentation/internal/reflection/ReflectionTest.java b/instrumentation/internal/internal-reflection/javaagent-integration-tests/src/test/java/io/opentelemetry/javaagent/instrumentation/internal/reflection/ReflectionTest.java index e4506ee6a59b..ce2a47969ed1 100644 --- a/instrumentation/internal/internal-reflection/javaagent-integration-tests/src/test/java/io/opentelemetry/javaagent/instrumentation/internal/reflection/ReflectionTest.java +++ b/instrumentation/internal/internal-reflection/javaagent-integration-tests/src/test/java/io/opentelemetry/javaagent/instrumentation/internal/reflection/ReflectionTest.java @@ -43,7 +43,7 @@ void testOurFieldsAndMethodsAreNotVisibleWithReflection() { void testGeneratedSerialVersionUid() { // expected value is computed with serialver utility that comes with jdk assertThat(ObjectStreamClass.lookup(TestClass.class).getSerialVersionUID()) - .isEqualTo(-1006206785953990857L); + .isEqualTo(7413560001584957796L); assertThat(TestClass.class.getDeclaredFields()).isEmpty(); } } diff --git a/instrumentation/internal/internal-reflection/javaagent-integration-tests/src/test/java/io/opentelemetry/javaagent/instrumentation/internal/reflection/TestClass.java b/instrumentation/internal/internal-reflection/javaagent-integration-tests/src/test/java/io/opentelemetry/javaagent/instrumentation/internal/reflection/TestClass.java index 9d921fba22e4..f3a0e3aee91e 100644 --- a/instrumentation/internal/internal-reflection/javaagent-integration-tests/src/test/java/io/opentelemetry/javaagent/instrumentation/internal/reflection/TestClass.java +++ b/instrumentation/internal/internal-reflection/javaagent-integration-tests/src/test/java/io/opentelemetry/javaagent/instrumentation/internal/reflection/TestClass.java @@ -7,7 +7,7 @@ import java.io.Serializable; -public class TestClass implements Runnable, Serializable { +class TestClass implements Runnable, Serializable { @Override public void run() {} From 2d3ab161ba0d3051a9a1413eba97ad33a05cf3e4 Mon Sep 17 00:00:00 2001 From: otelbot <197425009+otelbot@users.noreply.github.com> Date: Thu, 30 Apr 2026 07:27:38 +0000 Subject: [PATCH 3/9] Review fixes for java-http-client:javaagent Automated code review of instrumentation/java-http-client/javaagent. --- instrumentation/java-http-client/metadata.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/instrumentation/java-http-client/metadata.yaml b/instrumentation/java-http-client/metadata.yaml index f21ccd21ceba..8dca769f0449 100644 --- a/instrumentation/java-http-client/metadata.yaml +++ b/instrumentation/java-http-client/metadata.yaml @@ -23,6 +23,7 @@ configurations: type: list default: "" - name: otel.instrumentation.common.peer-service-mapping + declarative_name: java.common.peer_service_mapping description: Used to specify a mapping from host names or IP addresses to peer services. type: map default: "" From a64f04ea3157c4c286d2be627594962df1c478b2 Mon Sep 17 00:00:00 2001 From: otelbot <197425009+otelbot@users.noreply.github.com> Date: Thu, 30 Apr 2026 07:33:45 +0000 Subject: [PATCH 4/9] Review fixes for java-http-client:library Automated code review of instrumentation/java-http-client/library. --- .../javahttpclient/internal/ResponseConsumer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/instrumentation/java-http-client/library/src/main/java/io/opentelemetry/instrumentation/javahttpclient/internal/ResponseConsumer.java b/instrumentation/java-http-client/library/src/main/java/io/opentelemetry/instrumentation/javahttpclient/internal/ResponseConsumer.java index 6b14ba269837..6811a4dcb0a5 100644 --- a/instrumentation/java-http-client/library/src/main/java/io/opentelemetry/instrumentation/javahttpclient/internal/ResponseConsumer.java +++ b/instrumentation/java-http-client/library/src/main/java/io/opentelemetry/instrumentation/javahttpclient/internal/ResponseConsumer.java @@ -10,6 +10,7 @@ import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.util.function.BiConsumer; +import javax.annotation.Nullable; /** * This class is internal and is hence not for public use. Its APIs are unstable and can change at @@ -30,7 +31,7 @@ public ResponseConsumer( } @Override - public void accept(HttpResponse httpResponse, Throwable throwable) { + public void accept(@Nullable HttpResponse httpResponse, @Nullable Throwable throwable) { instrumenter.end(context, httpRequest, httpResponse, throwable); } } From 94a2e8288f0efef2774ddd5e97ead9a5036378ba Mon Sep 17 00:00:00 2001 From: otelbot <197425009+otelbot@users.noreply.github.com> Date: Thu, 30 Apr 2026 07:45:55 +0000 Subject: [PATCH 5/9] Review fixes for java-http-client:testing Automated code review of instrumentation/java-http-client/testing. --- .../AbstractJavaHttpClientTest.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/instrumentation/java-http-client/testing/src/main/java/io/opentelemetry/instrumentation/javahttpclient/AbstractJavaHttpClientTest.java b/instrumentation/java-http-client/testing/src/main/java/io/opentelemetry/instrumentation/javahttpclient/AbstractJavaHttpClientTest.java index c839bc91d845..aafdfb777daf 100644 --- a/instrumentation/java-http-client/testing/src/main/java/io/opentelemetry/instrumentation/javahttpclient/AbstractJavaHttpClientTest.java +++ b/instrumentation/java-http-client/testing/src/main/java/io/opentelemetry/instrumentation/javahttpclient/AbstractJavaHttpClientTest.java @@ -6,6 +6,7 @@ package io.opentelemetry.instrumentation.javahttpclient; import static io.opentelemetry.api.common.AttributeKey.stringKey; +import static io.opentelemetry.instrumentation.testing.junit.service.SemconvServiceStabilityUtil.maybeStablePeerService; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo; import static io.opentelemetry.semconv.ErrorAttributes.ERROR_TYPE; import static io.opentelemetry.semconv.HttpAttributes.HTTP_REQUEST_METHOD; @@ -13,6 +14,7 @@ import static io.opentelemetry.semconv.ServerAttributes.SERVER_ADDRESS; import static io.opentelemetry.semconv.ServerAttributes.SERVER_PORT; import static io.opentelemetry.semconv.UrlAttributes.URL_FULL; +import static io.opentelemetry.semconv.incubating.TelemetryIncubatingAttributes.TELEMETRY_DISTRO_NAME; import static java.util.concurrent.TimeUnit.SECONDS; import static org.assertj.core.api.Assertions.assertThatThrownBy; @@ -172,12 +174,21 @@ void cancelRequest() throws InterruptedException { .hasKind(SpanKind.CLIENT) .hasParent(trace.getSpan(0)) .hasStatus(StatusData.error()) - .hasAttributesSatisfying( + .hasAttributesSatisfyingExactly( equalTo(URL_FULL, uri.toString()), equalTo(SERVER_ADDRESS, uri.getHost()), equalTo(SERVER_PORT, uri.getPort()), equalTo(HTTP_REQUEST_METHOD, method), - equalTo(ERROR_TYPE, CancellationException.class.getName())), + equalTo(ERROR_TYPE, CancellationException.class.getName()), + equalTo( + maybeStablePeerService(), + "opentelemetry-java-instrumentation" + .equals( + span.actual() + .getResource() + .getAttribute(TELEMETRY_DISTRO_NAME)) + ? "test-peer-service" + : null)), span -> span.hasName("test-http-server") .hasKind(SpanKind.SERVER) From d74120838dea4240535c17523a3053d59662e89d Mon Sep 17 00:00:00 2001 From: otelbot <197425009+otelbot@users.noreply.github.com> Date: Thu, 30 Apr 2026 07:50:53 +0000 Subject: [PATCH 6/9] Review fixes for java-http-server:library Automated code review of instrumentation/java-http-server/library. --- instrumentation/java-http-server/metadata.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/instrumentation/java-http-server/metadata.yaml b/instrumentation/java-http-server/metadata.yaml index e3950d0efa7f..a1943d1da67e 100644 --- a/instrumentation/java-http-server/metadata.yaml +++ b/instrumentation/java-http-server/metadata.yaml @@ -23,6 +23,7 @@ configurations: type: list default: "" - name: otel.instrumentation.common.peer-service-mapping + declarative_name: java.common.peer_service_mapping description: Used to specify a mapping from host names or IP addresses to peer services. type: map default: "" From 2cc14b63a6229e6881d791fad000e6ec8df71ba8 Mon Sep 17 00:00:00 2001 From: otelbot <197425009+otelbot@users.noreply.github.com> Date: Thu, 30 Apr 2026 08:07:20 +0000 Subject: [PATCH 7/9] Review fixes for java-util-logging:javaagent Automated code review of instrumentation/java-util-logging/javaagent. --- .../java-util-logging/javaagent/build.gradle.kts | 2 -- .../javaagent/instrumentation/jul/JavaUtilLoggingTest.java | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/instrumentation/java-util-logging/javaagent/build.gradle.kts b/instrumentation/java-util-logging/javaagent/build.gradle.kts index 4428e5fd8203..1fd0552a75e3 100644 --- a/instrumentation/java-util-logging/javaagent/build.gradle.kts +++ b/instrumentation/java-util-logging/javaagent/build.gradle.kts @@ -5,8 +5,6 @@ plugins { dependencies { compileOnly(project(":instrumentation:java-util-logging:shaded-stub-for-instrumenting")) - compileOnly(project(":javaagent-bootstrap")) - // ensure no cross interference testInstrumentation(project(":instrumentation:jboss-logmanager:jboss-logmanager-appender-1.1:javaagent")) } diff --git a/instrumentation/java-util-logging/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jul/JavaUtilLoggingTest.java b/instrumentation/java-util-logging/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jul/JavaUtilLoggingTest.java index 904475d831de..0c6f060952bf 100644 --- a/instrumentation/java-util-logging/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jul/JavaUtilLoggingTest.java +++ b/instrumentation/java-util-logging/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jul/JavaUtilLoggingTest.java @@ -32,7 +32,7 @@ import org.junit.jupiter.params.provider.MethodSource; class JavaUtilLoggingTest { - private static final boolean isExperimentalAttributesEnabled = + private static final boolean EXPERIMENTAL_ATTRIBUTES = Boolean.getBoolean("otel.instrumentation.java-util-logging.experimental-log-attributes"); private static final Logger logger = Logger.getLogger("abc"); @@ -166,14 +166,14 @@ private interface LoggerMethod { } private static String experimental(String value) { - if (isExperimentalAttributesEnabled) { + if (EXPERIMENTAL_ATTRIBUTES) { return value; } return null; } private static Long experimental(long value) { - if (isExperimentalAttributesEnabled) { + if (EXPERIMENTAL_ATTRIBUTES) { return value; } return null; From bd27651273a12b338ca2725a6f8b20b40043c3b4 Mon Sep 17 00:00:00 2001 From: otelbot <197425009+otelbot@users.noreply.github.com> Date: Thu, 30 Apr 2026 08:17:32 +0000 Subject: [PATCH 8/9] Review fixes for jaxrs-client:jaxrs-client-2.0-testing Automated code review of instrumentation/jaxrs-client/jaxrs-client-2.0-testing. --- .../jaxrsclient/ResteasyProxyClientTest.java | 10 +++++----- .../jaxrsclient/ResteasyProxyResource.java | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/instrumentation/jaxrs-client/jaxrs-client-2.0-testing/src/test/java/io/opentelemetry/javaagent/instrumentation/jaxrsclient/ResteasyProxyClientTest.java b/instrumentation/jaxrs-client/jaxrs-client-2.0-testing/src/test/java/io/opentelemetry/javaagent/instrumentation/jaxrsclient/ResteasyProxyClientTest.java index 76c00c0f56a3..b571d8661cd9 100644 --- a/instrumentation/jaxrs-client/jaxrs-client-2.0-testing/src/test/java/io/opentelemetry/javaagent/instrumentation/jaxrsclient/ResteasyProxyClientTest.java +++ b/instrumentation/jaxrs-client/jaxrs-client-2.0-testing/src/test/java/io/opentelemetry/javaagent/instrumentation/jaxrsclient/ResteasyProxyClientTest.java @@ -59,15 +59,15 @@ public int sendRequest( Response response; if (proxyMethodName.equals("get_success")) { - response = proxy.get_success(param, isTestServer, requestId); + response = proxy.getSuccess(param, isTestServer, requestId); } else if (proxyMethodName.equals("post_success")) { - response = proxy.post_success(param, isTestServer, requestId); + response = proxy.postSuccess(param, isTestServer, requestId); } else if (proxyMethodName.equals("put_success")) { - response = proxy.put_success(param, isTestServer, requestId); + response = proxy.putSuccess(param, isTestServer, requestId); } else if (proxyMethodName.equals("get_error")) { - response = proxy.get_error(param, isTestServer, requestId); + response = proxy.getError(param, isTestServer, requestId); } else if (proxyMethodName.equals("get_client_error")) { - response = proxy.get_client_error(param, isTestServer, requestId); + response = proxy.getClientError(param, isTestServer, requestId); } else { throw new IllegalArgumentException("Unknown method: " + proxyMethodName); } diff --git a/instrumentation/jaxrs-client/jaxrs-client-2.0-testing/src/test/java/io/opentelemetry/javaagent/instrumentation/jaxrsclient/ResteasyProxyResource.java b/instrumentation/jaxrs-client/jaxrs-client-2.0-testing/src/test/java/io/opentelemetry/javaagent/instrumentation/jaxrsclient/ResteasyProxyResource.java index 71aec42ab442..eaeb15531258 100644 --- a/instrumentation/jaxrs-client/jaxrs-client-2.0-testing/src/test/java/io/opentelemetry/javaagent/instrumentation/jaxrsclient/ResteasyProxyResource.java +++ b/instrumentation/jaxrs-client/jaxrs-client-2.0-testing/src/test/java/io/opentelemetry/javaagent/instrumentation/jaxrsclient/ResteasyProxyResource.java @@ -17,35 +17,35 @@ interface ResteasyProxyResource { @GET @Path("error") - Response get_error( + Response getError( @QueryParam("with") String param, @HeaderParam("is-test-server") String isTestServer, @HeaderParam("test-request-id") String requestId); @GET @Path("client-error") - Response get_client_error( + Response getClientError( @QueryParam("with") String param, @HeaderParam("is-test-server") String isTestServer, @HeaderParam("test-request-id") String requestId); @GET @Path("success") - Response get_success( + Response getSuccess( @QueryParam("with") String param, @HeaderParam("is-test-server") String isTestServer, @HeaderParam("test-request-id") String requestId); @POST @Path("success") - Response post_success( + Response postSuccess( @QueryParam("with") String param, @HeaderParam("is-test-server") String isTestServer, @HeaderParam("test-request-id") String requestId); @PUT @Path("success") - Response put_success( + Response putSuccess( @QueryParam("with") String param, @HeaderParam("is-test-server") String isTestServer, @HeaderParam("test-request-id") String requestId); From f4c088adf53cc72245befcf7aad3e695bf3b9ba1 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Thu, 30 Apr 2026 10:12:06 -0700 Subject: [PATCH 9/9] simplify --- .../javahttpclient/JavaHttpClientTest.java | 5 +++++ .../javahttpclient/AbstractJavaHttpClientTest.java | 13 +++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/instrumentation/java-http-client/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/javahttpclient/JavaHttpClientTest.java b/instrumentation/java-http-client/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/javahttpclient/JavaHttpClientTest.java index 8846201f662a..89bd9df54160 100644 --- a/instrumentation/java-http-client/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/javahttpclient/JavaHttpClientTest.java +++ b/instrumentation/java-http-client/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/javahttpclient/JavaHttpClientTest.java @@ -23,6 +23,11 @@ abstract static class AbstractTest extends AbstractJavaHttpClientTest { protected HttpClient configureHttpClient(HttpClient httpClient) { return httpClient; } + + @Override + protected boolean hasServicePeerName() { + return true; + } } @Nested diff --git a/instrumentation/java-http-client/testing/src/main/java/io/opentelemetry/instrumentation/javahttpclient/AbstractJavaHttpClientTest.java b/instrumentation/java-http-client/testing/src/main/java/io/opentelemetry/instrumentation/javahttpclient/AbstractJavaHttpClientTest.java index aafdfb777daf..10f9b3f30298 100644 --- a/instrumentation/java-http-client/testing/src/main/java/io/opentelemetry/instrumentation/javahttpclient/AbstractJavaHttpClientTest.java +++ b/instrumentation/java-http-client/testing/src/main/java/io/opentelemetry/instrumentation/javahttpclient/AbstractJavaHttpClientTest.java @@ -14,7 +14,6 @@ import static io.opentelemetry.semconv.ServerAttributes.SERVER_ADDRESS; import static io.opentelemetry.semconv.ServerAttributes.SERVER_PORT; import static io.opentelemetry.semconv.UrlAttributes.URL_FULL; -import static io.opentelemetry.semconv.incubating.TelemetryIncubatingAttributes.TELEMETRY_DISTRO_NAME; import static java.util.concurrent.TimeUnit.SECONDS; import static org.assertj.core.api.Assertions.assertThatThrownBy; @@ -57,6 +56,10 @@ void setUp() { protected abstract HttpClient configureHttpClient(HttpClient httpClient); + protected boolean hasServicePeerName() { + return false; + } + @Override public HttpRequest buildRequest(String method, URI uri, Map headers) { HttpRequest.Builder requestBuilder = @@ -182,13 +185,7 @@ void cancelRequest() throws InterruptedException { equalTo(ERROR_TYPE, CancellationException.class.getName()), equalTo( maybeStablePeerService(), - "opentelemetry-java-instrumentation" - .equals( - span.actual() - .getResource() - .getAttribute(TELEMETRY_DISTRO_NAME)) - ? "test-peer-service" - : null)), + hasServicePeerName() ? "test-peer-service" : null)), span -> span.hasName("test-http-server") .hasKind(SpanKind.SERVER)