From fb79c7c22ee746c904a95199390e295865024f73 Mon Sep 17 00:00:00 2001 From: brunobat Date: Mon, 23 Oct 2023 18:06:34 +0100 Subject: [PATCH] OTel upgrade to 1.31.0 --- bom/application/pom.xml | 24 +++++++-- .../InstrumentationProcessor.java | 8 ++- .../OpenTelemetryHttpCDILegacyTest.java | 2 +- .../deployment/OpenTelemetryHttpCDITest.java | 2 +- .../OpenTelemetryReactiveRoutesTest.java | 2 +- .../GraphQLOpenTelemetryTest.java | 6 +-- .../GrpcOpenTelemetryTest.java | 12 ++--- .../RestClientOpenTelemetryTest.java | 14 +++--- .../VertxClientOpenTelemetryTest.java | 18 +++---- .../VertxOpenTelemetryForwardedTest.java | 2 +- .../VertxOpenTelemetryTest.java | 18 +++---- .../VertxOpenTelemetryXForwardedTest.java | 2 +- extensions/opentelemetry/runtime/pom.xml | 8 ++- .../build/EndUserSpanProcessorConfig.java | 4 +- .../exporter/otlp/EndUserSpanProcessor.java | 2 +- .../runtime/tracing/DropTargetsSampler.java | 2 +- .../runtime/tracing/TracerRecorder.java | 2 +- .../runtime/tracing/TracerUtil.java | 4 +- .../grpc/GrpcStatusCodeExtractor.java | 2 +- ...ctiveMessagingTracingEmitterDecorator.java | 50 +++++++++++++++++++ ...iveMessagingTracingIncomingDecorator.java} | 38 +------------- ...tiveMessagingTracingOutgoingDecorator.java | 50 +++++++++++++++++++ .../restclient/OpenTelemetryClientFilter.java | 2 +- .../OpenTelemetryClassicServerFilter.java | 2 +- .../OpenTelemetryReactiveServerFilter.java | 2 +- .../vertx/HttpInstrumenterVertxTracer.java | 4 +- .../tracing/DropTargetsSamplerTest.java | 2 +- .../runtime/tracing/TracerUtilTest.java | 2 +- .../grpc/OpenTelemetryGrpcTest.java | 24 ++++----- .../OpenTelemetryReactiveClientTest.java | 8 +-- .../reactive/OpenTelemetryReactiveTest.java | 4 +- integration-tests/opentelemetry-spi/pom.xml | 2 +- .../opentelemetry/spi/CustomSPISampler.java | 2 +- .../vertx/exporter/AbstractExporterTest.java | 2 +- .../opentelemetry/vertx/HelloRouterTest.java | 16 +++--- .../it/opentelemetry/vertx/SqlClientTest.java | 10 ++-- .../it/opentelemetry/EndUserDisabledTest.java | 2 +- .../it/opentelemetry/EndUserEnabledTest.java | 2 +- 38 files changed, 226 insertions(+), 132 deletions(-) create mode 100644 extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/reactivemessaging/ReactiveMessagingTracingEmitterDecorator.java rename extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/reactivemessaging/{ReactiveMessagingTracingDecorator.java => ReactiveMessagingTracingIncomingDecorator.java} (56%) create mode 100644 extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/reactivemessaging/ReactiveMessagingTracingOutgoingDecorator.java diff --git a/bom/application/pom.xml b/bom/application/pom.xml index c2aaf18a4f876..d9acaabdde5e8 100644 --- a/bom/application/pom.xml +++ b/bom/application/pom.xml @@ -31,8 +31,9 @@ 0.2.4 0.1.15 0.1.5 - 1.30.1 - 1.30.0-alpha + 1.31.0 + 1.31.0-alpha + 1.21.0-alpha 5.0.3.Final 1.11.5 2.1.12 @@ -61,7 +62,7 @@ 1.0.13 3.0.1 3.7.2 - 4.10.1 + 4.11.0 2.4.0 2.1.2 2.1.1 @@ -6202,6 +6203,23 @@ ${mime4j.version} + + + io.opentelemetry.semconv + opentelemetry-semconv + ${opentelemetry-semconv.version} + + + io.opentelemetry + opentelemetry-bom + + + io.opentelemetry + opentelemetry-api + + + + io.quarkus diff --git a/extensions/opentelemetry/deployment/src/main/java/io/quarkus/opentelemetry/deployment/tracing/instrumentation/InstrumentationProcessor.java b/extensions/opentelemetry/deployment/src/main/java/io/quarkus/opentelemetry/deployment/tracing/instrumentation/InstrumentationProcessor.java index 1bac28f2b0fe3..83101515d740c 100644 --- a/extensions/opentelemetry/deployment/src/main/java/io/quarkus/opentelemetry/deployment/tracing/instrumentation/InstrumentationProcessor.java +++ b/extensions/opentelemetry/deployment/src/main/java/io/quarkus/opentelemetry/deployment/tracing/instrumentation/InstrumentationProcessor.java @@ -23,7 +23,9 @@ import io.quarkus.opentelemetry.runtime.tracing.intrumentation.InstrumentationRecorder; import io.quarkus.opentelemetry.runtime.tracing.intrumentation.grpc.GrpcTracingClientInterceptor; import io.quarkus.opentelemetry.runtime.tracing.intrumentation.grpc.GrpcTracingServerInterceptor; -import io.quarkus.opentelemetry.runtime.tracing.intrumentation.reactivemessaging.ReactiveMessagingTracingDecorator; +import io.quarkus.opentelemetry.runtime.tracing.intrumentation.reactivemessaging.ReactiveMessagingTracingEmitterDecorator; +import io.quarkus.opentelemetry.runtime.tracing.intrumentation.reactivemessaging.ReactiveMessagingTracingIncomingDecorator; +import io.quarkus.opentelemetry.runtime.tracing.intrumentation.reactivemessaging.ReactiveMessagingTracingOutgoingDecorator; import io.quarkus.opentelemetry.runtime.tracing.intrumentation.restclient.OpenTelemetryClientFilter; import io.quarkus.opentelemetry.runtime.tracing.intrumentation.resteasy.AttachExceptionHandler; import io.quarkus.opentelemetry.runtime.tracing.intrumentation.resteasy.OpenTelemetryClassicServerFilter; @@ -90,7 +92,9 @@ void registerReactiveMessagingMessageDecorator( Capabilities capabilities, BuildProducer additionalBeans) { if (capabilities.isPresent(Capability.SMALLRYE_REACTIVE_MESSAGING)) { - additionalBeans.produce(new AdditionalBeanBuildItem(ReactiveMessagingTracingDecorator.class)); + additionalBeans.produce(new AdditionalBeanBuildItem(ReactiveMessagingTracingOutgoingDecorator.class)); + additionalBeans.produce(new AdditionalBeanBuildItem(ReactiveMessagingTracingIncomingDecorator.class)); + additionalBeans.produce(new AdditionalBeanBuildItem(ReactiveMessagingTracingEmitterDecorator.class)); } } diff --git a/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/OpenTelemetryHttpCDILegacyTest.java b/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/OpenTelemetryHttpCDILegacyTest.java index 5fc76afd35d2a..dd03e834fa0a9 100644 --- a/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/OpenTelemetryHttpCDILegacyTest.java +++ b/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/OpenTelemetryHttpCDILegacyTest.java @@ -24,7 +24,7 @@ import io.opentelemetry.extension.annotations.WithSpan; import io.opentelemetry.sdk.trace.data.SpanData; -import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; +import io.opentelemetry.semconv.SemanticAttributes; import io.quarkus.opentelemetry.deployment.common.TestSpanExporter; import io.quarkus.opentelemetry.deployment.common.TestSpanExporterProvider; import io.quarkus.opentelemetry.deployment.common.TestUtil; diff --git a/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/OpenTelemetryHttpCDITest.java b/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/OpenTelemetryHttpCDITest.java index 92692bc32aaaa..19027b911c568 100644 --- a/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/OpenTelemetryHttpCDITest.java +++ b/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/OpenTelemetryHttpCDITest.java @@ -24,7 +24,7 @@ import io.opentelemetry.instrumentation.annotations.WithSpan; import io.opentelemetry.sdk.trace.data.SpanData; -import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; +import io.opentelemetry.semconv.SemanticAttributes; import io.quarkus.opentelemetry.deployment.common.TestSpanExporter; import io.quarkus.opentelemetry.deployment.common.TestSpanExporterProvider; import io.quarkus.opentelemetry.deployment.common.TestUtil; diff --git a/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/OpenTelemetryReactiveRoutesTest.java b/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/OpenTelemetryReactiveRoutesTest.java index e127973ea23cc..2af44b8e60a37 100644 --- a/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/OpenTelemetryReactiveRoutesTest.java +++ b/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/OpenTelemetryReactiveRoutesTest.java @@ -19,7 +19,7 @@ import org.junit.jupiter.api.extension.RegisterExtension; import io.opentelemetry.sdk.trace.data.SpanData; -import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; +import io.opentelemetry.semconv.SemanticAttributes; import io.quarkus.opentelemetry.deployment.common.TestSpanExporter; import io.quarkus.opentelemetry.deployment.common.TestSpanExporterProvider; import io.quarkus.opentelemetry.deployment.common.TestUtil; diff --git a/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/GraphQLOpenTelemetryTest.java b/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/GraphQLOpenTelemetryTest.java index 765d5e5ca9284..0985ac324ac7f 100644 --- a/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/GraphQLOpenTelemetryTest.java +++ b/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/GraphQLOpenTelemetryTest.java @@ -1,9 +1,9 @@ package io.quarkus.opentelemetry.deployment.instrumentation; import static io.opentelemetry.api.common.AttributeKey.stringKey; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_METHOD; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_ROUTE; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_STATUS_CODE; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_METHOD; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_ROUTE; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_STATUS_CODE; import static io.quarkus.opentelemetry.deployment.common.TestSpanExporter.getSpanByKindAndParentId; import static java.net.HttpURLConnection.HTTP_OK; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/GrpcOpenTelemetryTest.java b/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/GrpcOpenTelemetryTest.java index c4a7a62468413..edc1de34f739b 100644 --- a/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/GrpcOpenTelemetryTest.java +++ b/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/GrpcOpenTelemetryTest.java @@ -4,12 +4,12 @@ import static io.opentelemetry.api.trace.SpanKind.CLIENT; import static io.opentelemetry.api.trace.SpanKind.INTERNAL; import static io.opentelemetry.api.trace.SpanKind.SERVER; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.NET_HOST_PORT; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.NET_SOCK_HOST_ADDR; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.RPC_GRPC_STATUS_CODE; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.RPC_METHOD; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.RPC_SERVICE; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.RPC_SYSTEM; +import static io.opentelemetry.semconv.SemanticAttributes.NET_HOST_PORT; +import static io.opentelemetry.semconv.SemanticAttributes.NET_SOCK_HOST_ADDR; +import static io.opentelemetry.semconv.SemanticAttributes.RPC_GRPC_STATUS_CODE; +import static io.opentelemetry.semconv.SemanticAttributes.RPC_METHOD; +import static io.opentelemetry.semconv.SemanticAttributes.RPC_SERVICE; +import static io.opentelemetry.semconv.SemanticAttributes.RPC_SYSTEM; import static io.quarkus.opentelemetry.deployment.common.TestSpanExporter.getSpanByKindAndParentId; import static io.quarkus.opentelemetry.runtime.config.build.OTelBuildConfig.INSTRUMENTATION_NAME; import static org.assertj.core.api.Assertions.assertThat; diff --git a/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/RestClientOpenTelemetryTest.java b/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/RestClientOpenTelemetryTest.java index 110b7a0a340fb..0ee590b103c22 100644 --- a/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/RestClientOpenTelemetryTest.java +++ b/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/RestClientOpenTelemetryTest.java @@ -2,13 +2,13 @@ import static io.opentelemetry.api.trace.SpanKind.CLIENT; import static io.opentelemetry.api.trace.SpanKind.SERVER; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_METHOD; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_ROUTE; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_STATUS_CODE; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_TARGET; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_URL; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.NET_HOST_NAME; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.NET_HOST_PORT; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_METHOD; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_ROUTE; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_STATUS_CODE; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_TARGET; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_URL; +import static io.opentelemetry.semconv.SemanticAttributes.NET_HOST_NAME; +import static io.opentelemetry.semconv.SemanticAttributes.NET_HOST_PORT; import static io.quarkus.opentelemetry.deployment.common.TestSpanExporter.getSpanByKindAndParentId; import static java.net.HttpURLConnection.HTTP_OK; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/VertxClientOpenTelemetryTest.java b/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/VertxClientOpenTelemetryTest.java index c20222d95aca3..e725a51525afa 100644 --- a/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/VertxClientOpenTelemetryTest.java +++ b/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/VertxClientOpenTelemetryTest.java @@ -2,15 +2,15 @@ import static io.opentelemetry.api.trace.SpanKind.CLIENT; import static io.opentelemetry.api.trace.SpanKind.SERVER; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_METHOD; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_ROUTE; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_STATUS_CODE; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_TARGET; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_URL; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.NET_HOST_NAME; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.NET_HOST_PORT; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.NET_PEER_NAME; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.NET_PEER_PORT; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_METHOD; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_ROUTE; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_STATUS_CODE; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_TARGET; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_URL; +import static io.opentelemetry.semconv.SemanticAttributes.NET_HOST_NAME; +import static io.opentelemetry.semconv.SemanticAttributes.NET_HOST_PORT; +import static io.opentelemetry.semconv.SemanticAttributes.NET_PEER_NAME; +import static io.opentelemetry.semconv.SemanticAttributes.NET_PEER_PORT; import static io.quarkus.opentelemetry.deployment.common.TestSpanExporter.getSpanByKindAndParentId; import static java.net.HttpURLConnection.HTTP_OK; import static java.util.stream.Collectors.toSet; diff --git a/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/VertxOpenTelemetryForwardedTest.java b/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/VertxOpenTelemetryForwardedTest.java index 49bd40799d1af..9556aa2bb1313 100644 --- a/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/VertxOpenTelemetryForwardedTest.java +++ b/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/VertxOpenTelemetryForwardedTest.java @@ -1,7 +1,7 @@ package io.quarkus.opentelemetry.deployment.instrumentation; import static io.opentelemetry.api.trace.SpanKind.SERVER; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_CLIENT_IP; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_CLIENT_IP; import static io.quarkus.opentelemetry.deployment.common.TestSpanExporter.getSpanByKindAndParentId; import static org.hamcrest.Matchers.is; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/VertxOpenTelemetryTest.java b/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/VertxOpenTelemetryTest.java index 34425de902614..79d8cdae41227 100644 --- a/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/VertxOpenTelemetryTest.java +++ b/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/VertxOpenTelemetryTest.java @@ -3,15 +3,15 @@ import static io.opentelemetry.api.common.AttributeKey.stringKey; import static io.opentelemetry.api.trace.SpanKind.INTERNAL; import static io.opentelemetry.api.trace.SpanKind.SERVER; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_CLIENT_IP; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_METHOD; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_ROUTE; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_SCHEME; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_STATUS_CODE; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_TARGET; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.NET_HOST_NAME; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.NET_HOST_PORT; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.USER_AGENT_ORIGINAL; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_CLIENT_IP; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_METHOD; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_ROUTE; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_SCHEME; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_STATUS_CODE; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_TARGET; +import static io.opentelemetry.semconv.SemanticAttributes.NET_HOST_NAME; +import static io.opentelemetry.semconv.SemanticAttributes.NET_HOST_PORT; +import static io.opentelemetry.semconv.SemanticAttributes.USER_AGENT_ORIGINAL; import static io.quarkus.opentelemetry.deployment.common.TestSpanExporter.getSpanByKindAndParentId; import static io.restassured.RestAssured.given; import static io.vertx.core.http.HttpMethod.GET; diff --git a/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/VertxOpenTelemetryXForwardedTest.java b/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/VertxOpenTelemetryXForwardedTest.java index 829270e86d015..e58f286f9df68 100644 --- a/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/VertxOpenTelemetryXForwardedTest.java +++ b/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/VertxOpenTelemetryXForwardedTest.java @@ -1,7 +1,7 @@ package io.quarkus.opentelemetry.deployment.instrumentation; import static io.opentelemetry.api.trace.SpanKind.SERVER; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_CLIENT_IP; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_CLIENT_IP; import static io.quarkus.opentelemetry.deployment.common.TestSpanExporter.getSpanByKindAndParentId; import static org.hamcrest.Matchers.is; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/extensions/opentelemetry/runtime/pom.xml b/extensions/opentelemetry/runtime/pom.xml index 7befd1be1b261..dd7d2fda4acde 100644 --- a/extensions/opentelemetry/runtime/pom.xml +++ b/extensions/opentelemetry/runtime/pom.xml @@ -80,7 +80,7 @@ opentelemetry-sdk-extension-autoconfigure-spi - io.opentelemetry + io.opentelemetry.semconv opentelemetry-semconv @@ -102,6 +102,12 @@ io.opentelemetry.instrumentation opentelemetry-instrumentation-api-semconv + + + io.opentelemetry.semconv + opentelemetry-semconv + + io.opentelemetry diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/config/build/EndUserSpanProcessorConfig.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/config/build/EndUserSpanProcessorConfig.java index 3a9d988406c91..2e261c0d3e89b 100644 --- a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/config/build/EndUserSpanProcessorConfig.java +++ b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/config/build/EndUserSpanProcessorConfig.java @@ -15,8 +15,8 @@ public interface EndUserSpanProcessorConfig { * Enable the {@link io.quarkus.opentelemetry.runtime.exporter.otlp.EndUserSpanProcessor}. *

* The {@link io.quarkus.opentelemetry.runtime.exporter.otlp.EndUserSpanProcessor} adds - * the {@link io.opentelemetry.semconv.trace.attributes.SemanticAttributes.ENDUSER_ID} - * and {@link io.opentelemetry.semconv.trace.attributes.SemanticAttributes.ENDUSER_ROLE} to the Span. + * the {@link io.opentelemetry.semconv.SemanticAttributes.ENDUSER_ID} + * and {@link io.opentelemetry.semconv.SemanticAttributes.ENDUSER_ROLE} to the Span. */ @WithDefault("false") Optional enabled(); diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/exporter/otlp/EndUserSpanProcessor.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/exporter/otlp/EndUserSpanProcessor.java index c30223f8a737b..a17cff566afd3 100644 --- a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/exporter/otlp/EndUserSpanProcessor.java +++ b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/exporter/otlp/EndUserSpanProcessor.java @@ -11,7 +11,7 @@ import io.opentelemetry.sdk.trace.ReadWriteSpan; import io.opentelemetry.sdk.trace.ReadableSpan; import io.opentelemetry.sdk.trace.SpanProcessor; -import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; +import io.opentelemetry.semconv.SemanticAttributes; import io.quarkus.security.identity.SecurityIdentity; @ApplicationScoped diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/DropTargetsSampler.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/DropTargetsSampler.java index 06aa5ecf48438..8222d2c99a74d 100644 --- a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/DropTargetsSampler.java +++ b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/DropTargetsSampler.java @@ -8,7 +8,7 @@ import io.opentelemetry.sdk.trace.data.LinkData; import io.opentelemetry.sdk.trace.samplers.Sampler; import io.opentelemetry.sdk.trace.samplers.SamplingResult; -import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; +import io.opentelemetry.semconv.SemanticAttributes; public class DropTargetsSampler implements Sampler { private final Sampler sampler; diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/TracerRecorder.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/TracerRecorder.java index 163ab17705b61..a0d5486ba0a3d 100644 --- a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/TracerRecorder.java +++ b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/TracerRecorder.java @@ -6,7 +6,7 @@ import io.opentelemetry.api.common.Attributes; import io.opentelemetry.sdk.resources.Resource; -import io.opentelemetry.semconv.resource.attributes.ResourceAttributes; +import io.opentelemetry.semconv.ResourceAttributes; import io.quarkus.arc.runtime.BeanContainer; import io.quarkus.runtime.annotations.Recorder; diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/TracerUtil.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/TracerUtil.java index 9c8e915904a04..2bcb46ecf6a8e 100644 --- a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/TracerUtil.java +++ b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/TracerUtil.java @@ -1,7 +1,7 @@ package io.quarkus.opentelemetry.runtime.tracing; -import static io.opentelemetry.semconv.resource.attributes.ResourceAttributes.HOST_NAME; -import static io.opentelemetry.semconv.resource.attributes.ResourceAttributes.SERVICE_NAME; +import static io.opentelemetry.semconv.ResourceAttributes.HOST_NAME; +import static io.opentelemetry.semconv.ResourceAttributes.SERVICE_NAME; import java.util.List; diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/grpc/GrpcStatusCodeExtractor.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/grpc/GrpcStatusCodeExtractor.java index f5e5cae9aa8de..73bb2c515e5f6 100644 --- a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/grpc/GrpcStatusCodeExtractor.java +++ b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/grpc/GrpcStatusCodeExtractor.java @@ -4,7 +4,7 @@ import io.opentelemetry.api.common.AttributesBuilder; import io.opentelemetry.context.Context; import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; -import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; +import io.opentelemetry.semconv.SemanticAttributes; class GrpcStatusCodeExtractor implements AttributesExtractor { @Override diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/reactivemessaging/ReactiveMessagingTracingEmitterDecorator.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/reactivemessaging/ReactiveMessagingTracingEmitterDecorator.java new file mode 100644 index 0000000000000..17f6541114ecd --- /dev/null +++ b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/reactivemessaging/ReactiveMessagingTracingEmitterDecorator.java @@ -0,0 +1,50 @@ +package io.quarkus.opentelemetry.runtime.tracing.intrumentation.reactivemessaging; + +import static io.quarkus.opentelemetry.runtime.tracing.intrumentation.reactivemessaging.ReactiveMessagingTracingOutgoingDecorator.decorateOutgoing; + +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; + +import org.eclipse.microprofile.reactive.messaging.Message; + +import io.smallrye.mutiny.Multi; +import io.smallrye.reactive.messaging.ChannelRegistry; +import io.smallrye.reactive.messaging.PublisherDecorator; + +/** + * Intercepts outgoing messages from emitters from Reactive Messaging connectors. + *

+ * For outgoing messages from emitters, if the message doesn't already contain a tracing metadata, it attaches one with the + * current + * OpenTelemetry context. + * Reactive messaging outbound connectors, if tracing is supported, will use that context as parent span to trace outbound + * message transmission. + */ +@ApplicationScoped +public class ReactiveMessagingTracingEmitterDecorator implements PublisherDecorator { + + @Override + public int getPriority() { + // Place the decorator before all others including the ContextDecorator which is priority 0 + // This is only important for the emitter case + return -1000; + } + + @Inject + ChannelRegistry registry; + + /** + * Incoming messages + */ + @Override + public Multi> decorate(Multi> publisher, + String channelName, boolean isConnector) { + Multi> multi = publisher; + if (!isConnector && registry.getEmitterNames().contains(channelName)) { + // Emitter is a special case for the emitter publisher + multi = decorateOutgoing(multi); + } + return multi; + } + +} diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/reactivemessaging/ReactiveMessagingTracingDecorator.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/reactivemessaging/ReactiveMessagingTracingIncomingDecorator.java similarity index 56% rename from extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/reactivemessaging/ReactiveMessagingTracingDecorator.java rename to extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/reactivemessaging/ReactiveMessagingTracingIncomingDecorator.java index cba4e77aba404..229074e81dc20 100644 --- a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/reactivemessaging/ReactiveMessagingTracingDecorator.java +++ b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/reactivemessaging/ReactiveMessagingTracingIncomingDecorator.java @@ -1,7 +1,5 @@ package io.quarkus.opentelemetry.runtime.tracing.intrumentation.reactivemessaging; -import java.util.List; - import jakarta.enterprise.context.ApplicationScoped; import org.eclipse.microprofile.reactive.messaging.Message; @@ -10,30 +8,19 @@ import io.quarkus.opentelemetry.runtime.QuarkusContextStorage; import io.smallrye.mutiny.Multi; import io.smallrye.reactive.messaging.PublisherDecorator; -import io.smallrye.reactive.messaging.SubscriberDecorator; import io.smallrye.reactive.messaging.TracingMetadata; import io.smallrye.reactive.messaging.providers.locals.LocalContextMetadata; /** - * Intercepts incoming and outgoing messages from Reactive Messaging connectors. + * Intercepts incoming messages from Reactive Messaging connectors. *

* For incoming messages, it fetches OpenTelemetry context from the message and attaches to the duplicated context of the * message. * Consumer methods will be called on this duplicated context, so the OpenTelemetry context associated with the incoming message * will be propagated. - *

- * For outgoing messages, if the message doesn't already contain a tracing metadata, it attaches one with the current - * OpenTelemetry context. - * Reactive messaging outbound connectors, if tracing is supported, will use that context as parent span to trace outbound - * message transmission. */ @ApplicationScoped -public class ReactiveMessagingTracingDecorator implements PublisherDecorator, SubscriberDecorator { - - @Override - public int getPriority() { - return 1000; - } +public class ReactiveMessagingTracingIncomingDecorator implements PublisherDecorator { /** * Incoming messages @@ -59,25 +46,4 @@ public Multi> decorate(Multi> publishe return multi; } - /** - * Outgoing messages - */ - @Override - public Multi> decorate(Multi> toBeSubscribed, - List channelName, boolean isConnector) { - Multi> multi = toBeSubscribed; - if (isConnector) { - // add TracingMetadata to the outgoing message if it doesn't exist already - multi = multi.map(m -> { - Message message = m; - if (m.getMetadata(TracingMetadata.class).isEmpty()) { - var otelContext = QuarkusContextStorage.INSTANCE.current(); - message = m.addMetadata(TracingMetadata.withCurrent(otelContext)); - } - return message; - }); - } - return multi; - } - } diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/reactivemessaging/ReactiveMessagingTracingOutgoingDecorator.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/reactivemessaging/ReactiveMessagingTracingOutgoingDecorator.java new file mode 100644 index 0000000000000..00531430dfcd3 --- /dev/null +++ b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/reactivemessaging/ReactiveMessagingTracingOutgoingDecorator.java @@ -0,0 +1,50 @@ +package io.quarkus.opentelemetry.runtime.tracing.intrumentation.reactivemessaging; + +import java.util.List; + +import jakarta.enterprise.context.ApplicationScoped; + +import org.eclipse.microprofile.reactive.messaging.Message; + +import io.quarkus.opentelemetry.runtime.QuarkusContextStorage; +import io.smallrye.mutiny.Multi; +import io.smallrye.reactive.messaging.SubscriberDecorator; +import io.smallrye.reactive.messaging.TracingMetadata; + +/** + * Intercepts outgoing messages from Reactive Messaging connectors. + *

+ * For outgoing messages, if the message doesn't already contain a tracing metadata, it attaches one with the current + * OpenTelemetry context. + * Reactive messaging outbound connectors, if tracing is supported, will use that context as parent span to trace outbound + * message transmission. + */ +@ApplicationScoped +public class ReactiveMessagingTracingOutgoingDecorator implements SubscriberDecorator { + + /** + * Outgoing messages + */ + @Override + public Multi> decorate(Multi> toBeSubscribed, + List channelName, boolean isConnector) { + Multi> multi = toBeSubscribed; + if (isConnector) { + // add TracingMetadata to the outgoing message if it doesn't exist already + multi = decorateOutgoing(multi); + } + return multi; + } + + static Multi> decorateOutgoing(Multi> multi) { + return multi.map(m -> { + Message message = m; + if (m.getMetadata(TracingMetadata.class).isEmpty()) { + var otelContext = QuarkusContextStorage.INSTANCE.current(); + message = m.addMetadata(TracingMetadata.withCurrent(otelContext)); + } + return message; + }); + } + +} diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/restclient/OpenTelemetryClientFilter.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/restclient/OpenTelemetryClientFilter.java index 993c391afa489..d94ae7032e5c2 100644 --- a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/restclient/OpenTelemetryClientFilter.java +++ b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/restclient/OpenTelemetryClientFilter.java @@ -26,7 +26,7 @@ import io.opentelemetry.instrumentation.api.instrumenter.http.HttpClientAttributesGetter; import io.opentelemetry.instrumentation.api.instrumenter.http.HttpSpanNameExtractor; import io.opentelemetry.instrumentation.api.instrumenter.http.HttpSpanStatusExtractor; -import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; +import io.opentelemetry.semconv.SemanticAttributes; import io.quarkus.arc.Unremovable; import io.quarkus.opentelemetry.runtime.QuarkusContextStorage; diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/resteasy/OpenTelemetryClassicServerFilter.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/resteasy/OpenTelemetryClassicServerFilter.java index 1b57e66e17345..c3251cf02738c 100644 --- a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/resteasy/OpenTelemetryClassicServerFilter.java +++ b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/resteasy/OpenTelemetryClassicServerFilter.java @@ -10,7 +10,7 @@ import io.opentelemetry.api.trace.Span; import io.opentelemetry.instrumentation.api.instrumenter.LocalRootSpan; -import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; +import io.opentelemetry.semconv.SemanticAttributes; /** * Handles RESTEasy Classic diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/resteasy/OpenTelemetryReactiveServerFilter.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/resteasy/OpenTelemetryReactiveServerFilter.java index ddf382a32f648..f000f2e44069d 100644 --- a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/resteasy/OpenTelemetryReactiveServerFilter.java +++ b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/resteasy/OpenTelemetryReactiveServerFilter.java @@ -7,7 +7,7 @@ import io.opentelemetry.api.trace.Span; import io.opentelemetry.instrumentation.api.instrumenter.LocalRootSpan; -import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; +import io.opentelemetry.semconv.SemanticAttributes; /** * Handles RESTEasy Reactive (via Vert.x) diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/HttpInstrumenterVertxTracer.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/HttpInstrumenterVertxTracer.java index eb7b88bd4c4ee..bb4f44309a4ba 100644 --- a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/HttpInstrumenterVertxTracer.java +++ b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/HttpInstrumenterVertxTracer.java @@ -1,7 +1,7 @@ package io.quarkus.opentelemetry.runtime.tracing.intrumentation.vertx; import static io.opentelemetry.instrumentation.api.instrumenter.http.HttpRouteSource.FILTER; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_CLIENT_IP; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_CLIENT_IP; import static io.quarkus.opentelemetry.runtime.config.build.OTelBuildConfig.INSTRUMENTATION_NAME; import java.net.URI; @@ -27,7 +27,7 @@ import io.opentelemetry.instrumentation.api.instrumenter.http.HttpServerAttributesGetter; import io.opentelemetry.instrumentation.api.instrumenter.http.HttpSpanNameExtractor; import io.opentelemetry.instrumentation.api.instrumenter.http.HttpSpanStatusExtractor; -import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; +import io.opentelemetry.semconv.SemanticAttributes; import io.vertx.core.Context; import io.vertx.core.MultiMap; import io.vertx.core.http.HttpHeaders; diff --git a/extensions/opentelemetry/runtime/src/test/java/io/quarkus/opentelemetry/runtime/tracing/DropTargetsSamplerTest.java b/extensions/opentelemetry/runtime/src/test/java/io/quarkus/opentelemetry/runtime/tracing/DropTargetsSamplerTest.java index 662c0538b2ab4..43de8f26064e7 100644 --- a/extensions/opentelemetry/runtime/src/test/java/io/quarkus/opentelemetry/runtime/tracing/DropTargetsSamplerTest.java +++ b/extensions/opentelemetry/runtime/src/test/java/io/quarkus/opentelemetry/runtime/tracing/DropTargetsSamplerTest.java @@ -13,7 +13,7 @@ import io.opentelemetry.sdk.trace.data.LinkData; import io.opentelemetry.sdk.trace.samplers.Sampler; import io.opentelemetry.sdk.trace.samplers.SamplingResult; -import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; +import io.opentelemetry.semconv.SemanticAttributes; class DropTargetsSamplerTest { diff --git a/extensions/opentelemetry/runtime/src/test/java/io/quarkus/opentelemetry/runtime/tracing/TracerUtilTest.java b/extensions/opentelemetry/runtime/src/test/java/io/quarkus/opentelemetry/runtime/tracing/TracerUtilTest.java index 99c005ce5ed91..9383d1824d3fb 100644 --- a/extensions/opentelemetry/runtime/src/test/java/io/quarkus/opentelemetry/runtime/tracing/TracerUtilTest.java +++ b/extensions/opentelemetry/runtime/src/test/java/io/quarkus/opentelemetry/runtime/tracing/TracerUtilTest.java @@ -8,7 +8,7 @@ import io.opentelemetry.api.common.Attributes; import io.opentelemetry.sdk.resources.Resource; -import io.opentelemetry.semconv.resource.attributes.ResourceAttributes; +import io.opentelemetry.semconv.ResourceAttributes; public class TracerUtilTest { diff --git a/integration-tests/opentelemetry-grpc/src/test/java/io/quarkus/it/opentelemetry/grpc/OpenTelemetryGrpcTest.java b/integration-tests/opentelemetry-grpc/src/test/java/io/quarkus/it/opentelemetry/grpc/OpenTelemetryGrpcTest.java index ff16ac9dadda2..b9a958be85242 100644 --- a/integration-tests/opentelemetry-grpc/src/test/java/io/quarkus/it/opentelemetry/grpc/OpenTelemetryGrpcTest.java +++ b/integration-tests/opentelemetry-grpc/src/test/java/io/quarkus/it/opentelemetry/grpc/OpenTelemetryGrpcTest.java @@ -2,18 +2,18 @@ import static io.opentelemetry.api.trace.SpanKind.CLIENT; import static io.opentelemetry.api.trace.SpanKind.SERVER; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_METHOD; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_ROUTE; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_STATUS_CODE; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_TARGET; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.NET_HOST_PORT; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.NET_SOCK_HOST_ADDR; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.NET_SOCK_PEER_ADDR; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.NET_SOCK_PEER_PORT; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.RPC_GRPC_STATUS_CODE; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.RPC_METHOD; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.RPC_SERVICE; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.RPC_SYSTEM; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_METHOD; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_ROUTE; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_STATUS_CODE; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_TARGET; +import static io.opentelemetry.semconv.SemanticAttributes.NET_HOST_PORT; +import static io.opentelemetry.semconv.SemanticAttributes.NET_SOCK_HOST_ADDR; +import static io.opentelemetry.semconv.SemanticAttributes.NET_SOCK_PEER_ADDR; +import static io.opentelemetry.semconv.SemanticAttributes.NET_SOCK_PEER_PORT; +import static io.opentelemetry.semconv.SemanticAttributes.RPC_GRPC_STATUS_CODE; +import static io.opentelemetry.semconv.SemanticAttributes.RPC_METHOD; +import static io.opentelemetry.semconv.SemanticAttributes.RPC_SERVICE; +import static io.opentelemetry.semconv.SemanticAttributes.RPC_SYSTEM; import static io.restassured.RestAssured.given; import static io.restassured.RestAssured.when; import static java.net.HttpURLConnection.HTTP_OK; diff --git a/integration-tests/opentelemetry-reactive/src/test/java/io/quarkus/it/opentelemetry/reactive/OpenTelemetryReactiveClientTest.java b/integration-tests/opentelemetry-reactive/src/test/java/io/quarkus/it/opentelemetry/reactive/OpenTelemetryReactiveClientTest.java index 9307ce24f602b..d552573c74408 100644 --- a/integration-tests/opentelemetry-reactive/src/test/java/io/quarkus/it/opentelemetry/reactive/OpenTelemetryReactiveClientTest.java +++ b/integration-tests/opentelemetry-reactive/src/test/java/io/quarkus/it/opentelemetry/reactive/OpenTelemetryReactiveClientTest.java @@ -3,10 +3,10 @@ import static io.opentelemetry.api.trace.SpanKind.CLIENT; import static io.opentelemetry.api.trace.SpanKind.INTERNAL; import static io.opentelemetry.api.trace.SpanKind.SERVER; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_METHOD; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_ROUTE; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_STATUS_CODE; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_TARGET; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_METHOD; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_ROUTE; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_STATUS_CODE; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_TARGET; import static io.quarkus.it.opentelemetry.reactive.Utils.getSpanByKindAndParentId; import static io.quarkus.it.opentelemetry.reactive.Utils.getSpans; import static io.restassured.RestAssured.given; diff --git a/integration-tests/opentelemetry-reactive/src/test/java/io/quarkus/it/opentelemetry/reactive/OpenTelemetryReactiveTest.java b/integration-tests/opentelemetry-reactive/src/test/java/io/quarkus/it/opentelemetry/reactive/OpenTelemetryReactiveTest.java index 5b9ef8c7f9818..cdaba582dcb6e 100644 --- a/integration-tests/opentelemetry-reactive/src/test/java/io/quarkus/it/opentelemetry/reactive/OpenTelemetryReactiveTest.java +++ b/integration-tests/opentelemetry-reactive/src/test/java/io/quarkus/it/opentelemetry/reactive/OpenTelemetryReactiveTest.java @@ -3,8 +3,8 @@ import static io.opentelemetry.api.trace.SpanKind.CLIENT; import static io.opentelemetry.api.trace.SpanKind.INTERNAL; import static io.opentelemetry.api.trace.SpanKind.SERVER; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_TARGET; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_URL; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_TARGET; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_URL; import static io.quarkus.it.opentelemetry.reactive.Utils.getExceptionEventData; import static io.quarkus.it.opentelemetry.reactive.Utils.getSpanByKindAndParentId; import static io.quarkus.it.opentelemetry.reactive.Utils.getSpans; diff --git a/integration-tests/opentelemetry-spi/pom.xml b/integration-tests/opentelemetry-spi/pom.xml index d3ec4d9140e2e..dc77bd4e72af5 100644 --- a/integration-tests/opentelemetry-spi/pom.xml +++ b/integration-tests/opentelemetry-spi/pom.xml @@ -15,7 +15,7 @@ Quarkus - Integration Tests - OpenTelemetry SPI - 1.30.0-alpha + 1.31.0-alpha diff --git a/integration-tests/opentelemetry-spi/src/main/java/io/quarkus/it/opentelemetry/spi/CustomSPISampler.java b/integration-tests/opentelemetry-spi/src/main/java/io/quarkus/it/opentelemetry/spi/CustomSPISampler.java index be7e75f98d4ba..3d6f47cc55932 100644 --- a/integration-tests/opentelemetry-spi/src/main/java/io/quarkus/it/opentelemetry/spi/CustomSPISampler.java +++ b/integration-tests/opentelemetry-spi/src/main/java/io/quarkus/it/opentelemetry/spi/CustomSPISampler.java @@ -8,7 +8,7 @@ import io.opentelemetry.sdk.trace.data.LinkData; import io.opentelemetry.sdk.trace.samplers.Sampler; import io.opentelemetry.sdk.trace.samplers.SamplingResult; -import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; +import io.opentelemetry.semconv.SemanticAttributes; public class CustomSPISampler implements Sampler { @Override diff --git a/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/AbstractExporterTest.java b/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/AbstractExporterTest.java index 3fffe846f12fa..0dc4e49f6413f 100644 --- a/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/AbstractExporterTest.java +++ b/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/AbstractExporterTest.java @@ -16,7 +16,7 @@ import io.opentelemetry.proto.trace.v1.ResourceSpans; import io.opentelemetry.proto.trace.v1.ScopeSpans; import io.opentelemetry.proto.trace.v1.Span; -import io.opentelemetry.semconv.resource.attributes.ResourceAttributes; +import io.opentelemetry.semconv.ResourceAttributes; public abstract class AbstractExporterTest { diff --git a/integration-tests/opentelemetry-vertx/src/test/java/io/quarkus/it/opentelemetry/vertx/HelloRouterTest.java b/integration-tests/opentelemetry-vertx/src/test/java/io/quarkus/it/opentelemetry/vertx/HelloRouterTest.java index 0bb1b5455a464..7069126936f96 100644 --- a/integration-tests/opentelemetry-vertx/src/test/java/io/quarkus/it/opentelemetry/vertx/HelloRouterTest.java +++ b/integration-tests/opentelemetry-vertx/src/test/java/io/quarkus/it/opentelemetry/vertx/HelloRouterTest.java @@ -3,14 +3,14 @@ import static io.opentelemetry.api.trace.SpanKind.CONSUMER; import static io.opentelemetry.api.trace.SpanKind.PRODUCER; import static io.opentelemetry.api.trace.SpanKind.SERVER; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_METHOD; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_ROUTE; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_STATUS_CODE; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.MESSAGING_DESTINATION_NAME; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.MESSAGING_OPERATION; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.MESSAGING_SYSTEM; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_METHOD; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_ROUTE; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_STATUS_CODE; +import static io.opentelemetry.semconv.SemanticAttributes.MESSAGING_DESTINATION_NAME; +import static io.opentelemetry.semconv.SemanticAttributes.MESSAGING_OPERATION; +import static io.opentelemetry.semconv.SemanticAttributes.MESSAGING_SYSTEM; import static io.restassured.RestAssured.get; import static io.restassured.RestAssured.given; import static java.net.HttpURLConnection.HTTP_OK; diff --git a/integration-tests/opentelemetry-vertx/src/test/java/io/quarkus/it/opentelemetry/vertx/SqlClientTest.java b/integration-tests/opentelemetry-vertx/src/test/java/io/quarkus/it/opentelemetry/vertx/SqlClientTest.java index ce5b827923b5a..9a66684bcbbf0 100644 --- a/integration-tests/opentelemetry-vertx/src/test/java/io/quarkus/it/opentelemetry/vertx/SqlClientTest.java +++ b/integration-tests/opentelemetry-vertx/src/test/java/io/quarkus/it/opentelemetry/vertx/SqlClientTest.java @@ -1,11 +1,11 @@ package io.quarkus.it.opentelemetry.vertx; import static io.opentelemetry.api.trace.SpanKind.CLIENT; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.DB_CONNECTION_STRING; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.DB_OPERATION; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.DB_STATEMENT; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.DB_USER; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_STATUS_CODE; +import static io.opentelemetry.semconv.SemanticAttributes.DB_CONNECTION_STRING; +import static io.opentelemetry.semconv.SemanticAttributes.DB_OPERATION; +import static io.opentelemetry.semconv.SemanticAttributes.DB_STATEMENT; +import static io.opentelemetry.semconv.SemanticAttributes.DB_USER; +import static io.opentelemetry.semconv.SemanticAttributes.HTTP_STATUS_CODE; import static io.restassured.RestAssured.given; import static java.net.HttpURLConnection.HTTP_OK; import static org.awaitility.Awaitility.await; diff --git a/integration-tests/opentelemetry/src/test/java/io/quarkus/it/opentelemetry/EndUserDisabledTest.java b/integration-tests/opentelemetry/src/test/java/io/quarkus/it/opentelemetry/EndUserDisabledTest.java index 2fe83999e1c9e..8fee9dcd3a0ba 100644 --- a/integration-tests/opentelemetry/src/test/java/io/quarkus/it/opentelemetry/EndUserDisabledTest.java +++ b/integration-tests/opentelemetry/src/test/java/io/quarkus/it/opentelemetry/EndUserDisabledTest.java @@ -5,7 +5,7 @@ import jakarta.enterprise.inject.Instance; import io.opentelemetry.api.common.Attributes; -import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; +import io.opentelemetry.semconv.SemanticAttributes; import io.quarkus.test.junit.QuarkusTest; @QuarkusTest diff --git a/integration-tests/opentelemetry/src/test/java/io/quarkus/it/opentelemetry/EndUserEnabledTest.java b/integration-tests/opentelemetry/src/test/java/io/quarkus/it/opentelemetry/EndUserEnabledTest.java index 965b7ddd0c166..dd3427fd0dd6b 100644 --- a/integration-tests/opentelemetry/src/test/java/io/quarkus/it/opentelemetry/EndUserEnabledTest.java +++ b/integration-tests/opentelemetry/src/test/java/io/quarkus/it/opentelemetry/EndUserEnabledTest.java @@ -5,7 +5,7 @@ import jakarta.enterprise.inject.Instance; import io.opentelemetry.api.common.Attributes; -import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; +import io.opentelemetry.semconv.SemanticAttributes; import io.quarkus.it.opentelemetry.util.EndUserProfile; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.junit.TestProfile;