sampler;
@@ -138,10 +135,7 @@ public Sampler apply(Sampler existingSampler, ConfigProperties configProperties)
// make sure dropped targets are not sampled
if (!dropTargets.isEmpty()) {
- return new DropTargetsSampler(effectiveSampler,
- dropTargets,
- getSemconvStabilityOptin(
- configProperties.getString(OTEL_SEMCONV_STABILITY_OPT_IN)));
+ return new DropTargetsSampler(effectiveSampler, dropTargets);
} else {
return effectiveSampler;
}
diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/OpenTelemetryRecorder.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/OpenTelemetryRecorder.java
index 0967428012cb2..bcf640e928bdf 100644
--- a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/OpenTelemetryRecorder.java
+++ b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/OpenTelemetryRecorder.java
@@ -14,7 +14,7 @@
import io.opentelemetry.api.GlobalOpenTelemetry;
import io.opentelemetry.api.OpenTelemetry;
-import io.opentelemetry.api.events.GlobalEventEmitterProvider;
+import io.opentelemetry.api.incubator.events.GlobalEventLoggerProvider;
import io.opentelemetry.context.ContextStorage;
import io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdk;
import io.quarkus.arc.SyntheticCreationalContext;
@@ -35,7 +35,7 @@ public class OpenTelemetryRecorder {
@StaticInit
public void resetGlobalOpenTelemetryForDevMode() {
GlobalOpenTelemetry.resetForTest();
- GlobalEventEmitterProvider.resetForTest();
+ GlobalEventLoggerProvider.resetForTest();
}
@RuntimeInit
diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/OpenTelemetryUtil.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/OpenTelemetryUtil.java
index 1b2894cc49a25..de8326f931aeb 100644
--- a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/OpenTelemetryUtil.java
+++ b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/OpenTelemetryUtil.java
@@ -12,7 +12,6 @@
import io.opentelemetry.api.trace.SpanContext;
import io.opentelemetry.context.Context;
import io.opentelemetry.sdk.trace.ReadableSpan;
-import io.quarkus.opentelemetry.runtime.config.runtime.SemconvStabilityType;
import io.quarkus.vertx.core.runtime.VertxMDC;
public final class OpenTelemetryUtil {
@@ -112,16 +111,4 @@ public static void clearMDCData(io.vertx.core.Context vertxContext) {
vertxMDC.remove(PARENT_ID, vertxContext);
vertxMDC.remove(SAMPLED, vertxContext);
}
-
- public static SemconvStabilityType getSemconvStabilityOptin(String config) {
- if (config == null || config.isBlank()) {
- return SemconvStabilityType.HTTP_OLD;
- }
-
- try {
- return SemconvStabilityType.fromValue(config);
- } catch (IllegalArgumentException e) {
- return SemconvStabilityType.HTTP_OLD;
- }
- }
}
diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/config/runtime/OTelRuntimeConfig.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/config/runtime/OTelRuntimeConfig.java
index 8960f04d76f53..ef7ca8abcfab8 100644
--- a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/config/runtime/OTelRuntimeConfig.java
+++ b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/config/runtime/OTelRuntimeConfig.java
@@ -82,21 +82,6 @@ public interface OTelRuntimeConfig {
*/
InstrumentRuntimeConfig instrument();
- /**
- * Opt-in to emit stable OpenTelemetry semantic conventions or a
- * duplication of the old plus the new semantic convention attribute names.
- *
- * - http
- emit the new, stable HTTP and networking attributes, and stop emitting the old
- * experimental HTTP and networking attributes that the instrumentation emitted previously.
- *
- * - http/dup
- emit both the old and the stable HTTP and networking attributes, allowing
- * for a more seamless transition.
- *
- * The default, by not defining a property value, will mean the use of the old legacy semantic attribute names.
- */
- @WithName("semconv-stability.opt-in")
- Optional otelSemconvStabilityOptIn();
-
/**
* Prioritize OpenTelemetry configuration otel.
on top of Quarkus OpenTelemetry configuration
* quarkus.otel
.
diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/config/runtime/SemconvStabilityType.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/config/runtime/SemconvStabilityType.java
deleted file mode 100644
index be0d7f71ba66d..0000000000000
--- a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/config/runtime/SemconvStabilityType.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package io.quarkus.opentelemetry.runtime.config.runtime;
-
-public enum SemconvStabilityType {
- /**
- * Emit the new stable convention names
- */
- HTTP("http"),
- /**
- * Emit the old unstable plus the new stable convention names for transition purposes
- */
- HTTP_DUP("http/dup"),
- /**
- * Emit the old unstable convention names.
- *
- * This is a non standard property name, only used in Quarkus.
- */
- HTTP_OLD("http/old");
-
- private final String value;
-
- SemconvStabilityType(String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
-
- public static SemconvStabilityType fromValue(String value) {
- for (SemconvStabilityType type : values()) {
- if (type.value.equals(value)) {
- return type;
- }
- }
- throw new IllegalArgumentException("No enum constant with value: " + value);
- }
-
- static class Constants {
- public static final String HTTP = "http";
- public static final String HTTP_DUP = "http/dup";
- public static final String HTTP_OLD = "http/old";
- }
-}
diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/exporter/otlp/sender/VertxHttpSender.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/exporter/otlp/sender/VertxHttpSender.java
index e3178c18f856e..aa56e704d2699 100644
--- a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/exporter/otlp/sender/VertxHttpSender.java
+++ b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/exporter/otlp/sender/VertxHttpSender.java
@@ -18,6 +18,7 @@
import java.util.zip.GZIPOutputStream;
import io.opentelemetry.exporter.internal.http.HttpSender;
+import io.opentelemetry.exporter.internal.marshal.Marshaler;
import io.opentelemetry.sdk.common.CompletableResultCode;
import io.opentelemetry.sdk.internal.ThrottlingLogger;
import io.quarkus.vertx.core.runtime.BufferOutputStream;
@@ -91,7 +92,7 @@ private static String determineBasePath(URI baseUri) {
}
@Override
- public void send(Consumer marshaler,
+ public void send(Marshaler marshaler,
int contentLength,
Consumer onHttpResponseRead,
Consumer onError) {
@@ -178,7 +179,7 @@ private static class ClientRequestSuccessHandler implements Handler onHttpResponseRead;
private final Consumer onError;
- private final Consumer marshaler;
+ private final Marshaler marshaler;
private final int attemptNumber;
private final Supplier isShutdown;
@@ -190,7 +191,7 @@ public ClientRequestSuccessHandler(HttpClient client,
int contentLength,
Consumer onHttpResponseRead,
Consumer onError,
- Consumer marshaler,
+ Marshaler marshaler,
int attemptNumber,
Supplier isShutdown) {
this.client = client;
@@ -281,12 +282,16 @@ public byte[] responseBody() {
if (compressionEnabled) {
clientRequest.putHeader("Content-Encoding", "gzip");
try (var gzos = new GZIPOutputStream(os)) {
- marshaler.accept(gzos);
+ marshaler.writeBinaryTo(gzos);
} catch (IOException e) {
throw new IllegalStateException(e);
}
} else {
- marshaler.accept(os);
+ try {
+ marshaler.writeBinaryTo(os);
+ } catch (IOException e) {
+ throw new IllegalStateException(e);
+ }
}
if (!headers.isEmpty()) {
diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/graal/Substitutions.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/graal/Substitutions.java
index f5809d4d27a19..ea5dcf5d13b34 100644
--- a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/graal/Substitutions.java
+++ b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/graal/Substitutions.java
@@ -7,10 +7,11 @@
import com.oracle.svm.core.annotate.Substitute;
import com.oracle.svm.core.annotate.TargetClass;
-import io.opentelemetry.api.events.EventEmitterProvider;
+import io.opentelemetry.api.incubator.events.EventLoggerProvider;
import io.opentelemetry.api.metrics.MeterProvider;
import io.opentelemetry.sdk.autoconfigure.internal.SpiHelper;
import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties;
+import io.opentelemetry.sdk.logs.LogRecordProcessor;
import io.opentelemetry.sdk.logs.SdkLoggerProviderBuilder;
import io.opentelemetry.sdk.logs.export.LogRecordExporter;
@@ -26,15 +27,16 @@ static void configureLoggerProvider(
SpiHelper spiHelper,
MeterProvider meterProvider,
BiFunction super LogRecordExporter, ConfigProperties, ? extends LogRecordExporter> logRecordExporterCustomizer,
+ BiFunction super LogRecordProcessor, ConfigProperties, ? extends LogRecordProcessor> logRecordProcessorCustomizer,
List closeables) {
// Logs not supported yet. No need to call LogRecordExporterConfiguration.configureExporter
}
}
- @TargetClass(className = "io.opentelemetry.api.events.GlobalEventEmitterProvider")
+ @TargetClass(className = "io.opentelemetry.api.incubator.events.GlobalEventLoggerProvider")
static final class Target_GlobalEventEmitterProvider {
@Substitute
- public static void set(EventEmitterProvider eventEmitterProvider) {
+ public static void set(EventLoggerProvider eventEmitterProvider) {
// do nothing. We don't support events yet. Default is EventEmitterProvider.noop()
}
}
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 d9c332d86c313..6e4b5fef9a29f 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
@@ -9,19 +9,15 @@
import io.opentelemetry.sdk.trace.samplers.Sampler;
import io.opentelemetry.sdk.trace.samplers.SamplingResult;
import io.opentelemetry.semconv.SemanticAttributes;
-import io.quarkus.opentelemetry.runtime.config.runtime.SemconvStabilityType;
public class DropTargetsSampler implements Sampler {
private final Sampler sampler;
private final List dropTargets;
- private final SemconvStabilityType semconvStabilityOptin;
public DropTargetsSampler(final Sampler sampler,
- final List dropTargets,
- final SemconvStabilityType semconvStabilityOptin) {
+ final List dropTargets) {
this.sampler = sampler;
this.dropTargets = dropTargets;
- this.semconvStabilityOptin = semconvStabilityOptin;
}
@Override
@@ -29,16 +25,11 @@ public SamplingResult shouldSample(Context parentContext, String traceId, String
Attributes attributes, List parentLinks) {
if (spanKind.equals(SpanKind.SERVER)) {
- String target;
- if (SemconvStabilityType.HTTP.equals(semconvStabilityOptin) ||
- SemconvStabilityType.HTTP_DUP.equals(semconvStabilityOptin)) {
- // HTTP_TARGET was split into url.path and url.query
- String path = attributes.get(SemanticAttributes.URL_PATH);
- String query = attributes.get(SemanticAttributes.URL_QUERY);
- target = path + (query == null ? "" : "?" + query);
- } else {
- target = attributes.get(SemanticAttributes.HTTP_TARGET);
- }
+ // HTTP_TARGET was split into url.path and url.query
+ String path = attributes.get(SemanticAttributes.URL_PATH);
+ String query = attributes.get(SemanticAttributes.URL_QUERY);
+ String target = path + (query == null ? "" : "?" + query);
+
if (shouldDrop(target)) {
return SamplingResult.drop();
}
diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/cdi/AddingSpanAttributesInterceptor.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/cdi/AddingSpanAttributesInterceptor.java
index 3eecc0f3cade5..37d47ed5f41d7 100644
--- a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/cdi/AddingSpanAttributesInterceptor.java
+++ b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/cdi/AddingSpanAttributesInterceptor.java
@@ -60,19 +60,12 @@ public String[] extract(final Method method, final Parameter[] parameters) {
}
private static String attributeName(Parameter parameter) {
- String value;
+ String value = null;
SpanAttribute spanAttribute = parameter.getDeclaredAnnotation(SpanAttribute.class);
- if (spanAttribute == null) {
- // Needed because SpanAttribute cannot be transformed
- io.opentelemetry.extension.annotations.SpanAttribute legacySpanAttribute = parameter.getDeclaredAnnotation(
- io.opentelemetry.extension.annotations.SpanAttribute.class);
- if (legacySpanAttribute == null) {
- return null;
- } else {
- value = legacySpanAttribute.value();
- }
- } else {
+ if (spanAttribute != null) {
value = spanAttribute.value();
+ } else {
+ return null;
}
if (!value.isEmpty()) {
diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/cdi/WithSpanInterceptor.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/cdi/WithSpanInterceptor.java
index 0061eb3c5b668..4e56bbdf4b0ea 100644
--- a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/cdi/WithSpanInterceptor.java
+++ b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/cdi/WithSpanInterceptor.java
@@ -22,11 +22,11 @@
import io.opentelemetry.instrumentation.annotations.WithSpan;
import io.opentelemetry.instrumentation.api.annotation.support.MethodSpanAttributesExtractor;
import io.opentelemetry.instrumentation.api.annotation.support.ParameterAttributeNamesExtractor;
+import io.opentelemetry.instrumentation.api.incubator.semconv.util.SpanNames;
import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
import io.opentelemetry.instrumentation.api.instrumenter.InstrumenterBuilder;
import io.opentelemetry.instrumentation.api.instrumenter.SpanKindExtractor;
import io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor;
-import io.opentelemetry.instrumentation.api.instrumenter.util.SpanNames;
import io.quarkus.arc.ArcInvocationContext;
import io.smallrye.mutiny.Multi;
import io.smallrye.mutiny.Uni;
@@ -210,19 +210,12 @@ public String[] extract(final Method method, final Parameter[] parameters) {
}
private static String attributeName(Parameter parameter) {
- String value;
+ String value = null;
SpanAttribute spanAttribute = parameter.getDeclaredAnnotation(SpanAttribute.class);
- if (spanAttribute == null) {
- // Needed because SpanAttribute cannot be transformed
- io.opentelemetry.extension.annotations.SpanAttribute legacySpanAttribute = parameter.getDeclaredAnnotation(
- io.opentelemetry.extension.annotations.SpanAttribute.class);
- if (legacySpanAttribute == null) {
- return null;
- } else {
- value = legacySpanAttribute.value();
- }
- } else {
+ if (spanAttribute != null) {
value = spanAttribute.value();
+ } else {
+ return null;
}
if (!value.isEmpty()) {
diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/InstrumentationRecorder.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/InstrumentationRecorder.java
index 11873ab929225..40aac71c43e0b 100644
--- a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/InstrumentationRecorder.java
+++ b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/InstrumentationRecorder.java
@@ -1,7 +1,5 @@
package io.quarkus.opentelemetry.runtime.tracing.intrumentation;
-import static io.quarkus.opentelemetry.runtime.OpenTelemetryUtil.getSemconvStabilityOptin;
-
import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;
@@ -45,11 +43,11 @@ public Consumer getVertxTracingOptions() {
/* RUNTIME INIT */
@RuntimeInit
public void setupVertxTracer(BeanContainer beanContainer, boolean sqlClientAvailable,
- boolean redisClientAvailable, final String semconvStability) {
+ boolean redisClientAvailable) {
OpenTelemetry openTelemetry = beanContainer.beanInstance(OpenTelemetry.class);
List> tracers = new ArrayList<>(4);
if (config.getValue().instrument().vertxHttp()) {
- tracers.add(new HttpInstrumenterVertxTracer(openTelemetry, getSemconvStabilityOptin(semconvStability)));
+ tracers.add(new HttpInstrumenterVertxTracer(openTelemetry));
}
if (config.getValue().instrument().vertxEventBus()) {
tracers.add(new EventBusInstrumenterVertxTracer(openTelemetry));
diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/grpc/GrpcAttributesGetter.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/grpc/GrpcAttributesGetter.java
index 9cc912eca23d3..6a8bf1c6016ba 100644
--- a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/grpc/GrpcAttributesGetter.java
+++ b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/grpc/GrpcAttributesGetter.java
@@ -1,6 +1,6 @@
package io.quarkus.opentelemetry.runtime.tracing.intrumentation.grpc;
-import io.opentelemetry.instrumentation.api.instrumenter.rpc.RpcAttributesGetter;
+import io.opentelemetry.instrumentation.api.incubator.semconv.rpc.RpcAttributesGetter;
enum GrpcAttributesGetter implements RpcAttributesGetter {
INSTANCE;
diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/grpc/GrpcTracingClientInterceptor.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/grpc/GrpcTracingClientInterceptor.java
index d66ec95ff92c7..1901857ccdd01 100644
--- a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/grpc/GrpcTracingClientInterceptor.java
+++ b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/grpc/GrpcTracingClientInterceptor.java
@@ -17,9 +17,9 @@
import io.opentelemetry.context.Context;
import io.opentelemetry.context.Scope;
import io.opentelemetry.context.propagation.TextMapSetter;
+import io.opentelemetry.instrumentation.api.incubator.semconv.rpc.RpcClientAttributesExtractor;
import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
import io.opentelemetry.instrumentation.api.instrumenter.InstrumenterBuilder;
-import io.opentelemetry.instrumentation.api.instrumenter.rpc.RpcClientAttributesExtractor;
import io.quarkus.grpc.GlobalInterceptor;
@Singleton
diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/grpc/GrpcTracingServerInterceptor.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/grpc/GrpcTracingServerInterceptor.java
index f059dc931561c..7d728a0e1c13c 100644
--- a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/grpc/GrpcTracingServerInterceptor.java
+++ b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/grpc/GrpcTracingServerInterceptor.java
@@ -6,11 +6,12 @@
import java.net.SocketAddress;
import java.util.Collections;
+import javax.annotation.Nullable;
+
import jakarta.inject.Singleton;
import io.grpc.ForwardingServerCall.SimpleForwardingServerCall;
import io.grpc.ForwardingServerCallListener.SimpleForwardingServerCallListener;
-import io.grpc.Grpc;
import io.grpc.Metadata;
import io.grpc.ServerCall;
import io.grpc.ServerCallHandler;
@@ -20,14 +21,13 @@
import io.opentelemetry.context.Context;
import io.opentelemetry.context.Scope;
import io.opentelemetry.context.propagation.TextMapGetter;
+import io.opentelemetry.instrumentation.api.incubator.semconv.rpc.RpcServerAttributesExtractor;
import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
import io.opentelemetry.instrumentation.api.instrumenter.InstrumenterBuilder;
-import io.opentelemetry.instrumentation.api.instrumenter.network.ClientAttributesExtractor;
-import io.opentelemetry.instrumentation.api.instrumenter.network.ClientAttributesGetter;
-import io.opentelemetry.instrumentation.api.instrumenter.network.NetworkAttributesGetter;
-import io.opentelemetry.instrumentation.api.instrumenter.network.ServerAttributesExtractor;
-import io.opentelemetry.instrumentation.api.instrumenter.network.ServerAttributesGetter;
-import io.opentelemetry.instrumentation.api.instrumenter.rpc.RpcServerAttributesExtractor;
+import io.opentelemetry.instrumentation.api.semconv.network.NetworkAttributesExtractor;
+import io.opentelemetry.instrumentation.api.semconv.network.NetworkAttributesGetter;
+import io.opentelemetry.instrumentation.api.semconv.network.ServerAttributesExtractor;
+import io.opentelemetry.instrumentation.api.semconv.network.ServerAttributesGetter;
import io.quarkus.grpc.GlobalInterceptor;
@Singleton
@@ -44,9 +44,8 @@ public GrpcTracingServerInterceptor(final OpenTelemetry openTelemetry) {
GrpcServerNetworkAttributesGetter getter = new GrpcServerNetworkAttributesGetter();
builder.addAttributesExtractor(RpcServerAttributesExtractor.create(GrpcAttributesGetter.INSTANCE))
- .addAttributesExtractor(
- ServerAttributesExtractor.createForServerSide(getter))
- .addAttributesExtractor(ClientAttributesExtractor.create(getter))
+ .addAttributesExtractor(ServerAttributesExtractor.create(getter))
+ .addAttributesExtractor(NetworkAttributesExtractor.create(getter))
.addAttributesExtractor(new GrpcStatusCodeExtractor())
.setSpanStatusExtractor(new GrpcSpanStatusExtractor());
@@ -72,8 +71,7 @@ public ServerCall.Listener interceptCall(
}
static class GrpcServerNetworkAttributesGetter implements NetworkAttributesGetter,
- ServerAttributesGetter,
- ClientAttributesGetter {
+ ServerAttributesGetter {
@Override
public String getServerAddress(GrpcRequest grpcRequest) {
@@ -86,19 +84,18 @@ public Integer getServerPort(GrpcRequest grpcRequest) {
}
@Override
- public InetSocketAddress getClientInetSocketAddress(GrpcRequest grpcRequest, Status status) {
- SocketAddress socketAddress = grpcRequest.getAttributes().get(Grpc.TRANSPORT_ATTR_REMOTE_ADDR);
- if (socketAddress instanceof InetSocketAddress) {
- return (InetSocketAddress) socketAddress;
- }
+ public InetSocketAddress getNetworkLocalInetSocketAddress(
+ GrpcRequest grpcRequest, @Nullable Status status) {
+ // TODO: later version introduces TRANSPORT_ATTR_LOCAL_ADDR, might be a good idea to use it
return null;
}
@Override
- public InetSocketAddress getServerInetSocketAddress(GrpcRequest grpcRequest, Status status) {
- SocketAddress socketAddress = grpcRequest.getAttributes().get(Grpc.TRANSPORT_ATTR_LOCAL_ADDR);
- if (socketAddress instanceof InetSocketAddress) {
- return (InetSocketAddress) socketAddress;
+ public InetSocketAddress getNetworkPeerInetSocketAddress(
+ GrpcRequest request, @Nullable Status status) {
+ SocketAddress address = request.getPeerSocketAddress();
+ if (address instanceof InetSocketAddress) {
+ return (InetSocketAddress) address;
}
return null;
}
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 c46e2ab4d2ade..c3ea205f6c2cf 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
@@ -23,11 +23,10 @@
import io.opentelemetry.context.propagation.TextMapSetter;
import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
import io.opentelemetry.instrumentation.api.instrumenter.InstrumenterBuilder;
-import io.opentelemetry.instrumentation.api.instrumenter.http.HttpClientAttributesExtractor;
-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.SemanticAttributes;
+import io.opentelemetry.instrumentation.api.semconv.http.HttpClientAttributesExtractor;
+import io.opentelemetry.instrumentation.api.semconv.http.HttpClientAttributesGetter;
+import io.opentelemetry.instrumentation.api.semconv.http.HttpSpanNameExtractor;
+import io.opentelemetry.instrumentation.api.semconv.http.HttpSpanStatusExtractor;
import io.quarkus.arc.Unremovable;
import io.quarkus.opentelemetry.runtime.QuarkusContextStorage;
@@ -160,11 +159,6 @@ public String getUrlFull(final ClientRequestContext request) {
return uri.toString();
}
- @Override
- public String getTransport(ClientRequestContext clientRequestContext, ClientResponseContext clientResponseContext) {
- return SemanticAttributes.NetTransportValues.IP_TCP;
- }
-
@Override
public String getServerAddress(ClientRequestContext clientRequestContext) {
return clientRequestContext.getUri().getHost();
diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/EventBusInstrumenterVertxTracer.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/EventBusInstrumenterVertxTracer.java
index 286c38c8aa617..e3aff4e8e2383 100644
--- a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/EventBusInstrumenterVertxTracer.java
+++ b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/EventBusInstrumenterVertxTracer.java
@@ -1,16 +1,16 @@
package io.quarkus.opentelemetry.runtime.tracing.intrumentation.vertx;
-import static io.opentelemetry.instrumentation.api.instrumenter.messaging.MessageOperation.PUBLISH;
-import static io.opentelemetry.instrumentation.api.instrumenter.messaging.MessageOperation.RECEIVE;
+import static io.opentelemetry.instrumentation.api.incubator.semconv.messaging.MessageOperation.PUBLISH;
+import static io.opentelemetry.instrumentation.api.incubator.semconv.messaging.MessageOperation.RECEIVE;
import static io.quarkus.opentelemetry.runtime.config.build.OTelBuildConfig.INSTRUMENTATION_NAME;
import io.opentelemetry.api.OpenTelemetry;
import io.opentelemetry.context.propagation.TextMapGetter;
+import io.opentelemetry.instrumentation.api.incubator.semconv.messaging.MessagingAttributesExtractor;
+import io.opentelemetry.instrumentation.api.incubator.semconv.messaging.MessagingAttributesGetter;
+import io.opentelemetry.instrumentation.api.incubator.semconv.messaging.MessagingSpanNameExtractor;
import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
import io.opentelemetry.instrumentation.api.instrumenter.InstrumenterBuilder;
-import io.opentelemetry.instrumentation.api.instrumenter.messaging.MessagingAttributesExtractor;
-import io.opentelemetry.instrumentation.api.instrumenter.messaging.MessagingAttributesGetter;
-import io.opentelemetry.instrumentation.api.instrumenter.messaging.MessagingSpanNameExtractor;
import io.vertx.core.eventbus.Message;
import io.vertx.core.spi.tracing.TagExtractor;
@@ -99,29 +99,49 @@ public String getDestination(final Message message) {
return message.address();
}
+ @Override
+ public String getDestinationTemplate(Message message) {
+ return "";
+ }
+
@Override
public boolean isTemporaryDestination(final Message message) {
return false;
}
+ @Override
+ public boolean isAnonymousDestination(Message message) {
+ return false;
+ }
+
@Override
public String getConversationId(final Message message) {
return message.replyAddress();
}
@Override
- public Long getMessagePayloadSize(final Message message) {
- return null;
+ public Long getMessageBodySize(Message message) {
+ return 0L;
}
@Override
- public Long getMessagePayloadCompressedSize(final Message message) {
- return null;
+ public Long getMessageEnvelopeSize(Message message) {
+ return 0L;
}
@Override
public String getMessageId(final Message message, final Message message2) {
return null;
}
+
+ @Override
+ public String getClientId(Message message) {
+ return "";
+ }
+
+ @Override
+ public Long getBatchMessageCount(Message message, Message message2) {
+ return 0L;
+ }
}
}
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 32ef18de5b1e3..40b3030204c24 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,8 +1,9 @@
package io.quarkus.opentelemetry.runtime.tracing.intrumentation.vertx;
-import static io.opentelemetry.instrumentation.api.instrumenter.http.HttpServerRouteSource.SERVER_FILTER;
+import static io.opentelemetry.instrumentation.api.semconv.http.HttpServerRouteSource.SERVER_FILTER;
import static io.opentelemetry.semconv.SemanticAttributes.CLIENT_ADDRESS;
-import static io.opentelemetry.semconv.SemanticAttributes.HTTP_CLIENT_IP;
+import static io.opentelemetry.semconv.SemanticAttributes.HTTP_REQUEST_BODY_SIZE;
+import static io.opentelemetry.semconv.SemanticAttributes.HTTP_RESPONSE_BODY_SIZE;
import static io.quarkus.opentelemetry.runtime.config.build.OTelBuildConfig.INSTRUMENTATION_NAME;
import java.net.URI;
@@ -22,15 +23,13 @@
import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
import io.opentelemetry.instrumentation.api.instrumenter.InstrumenterBuilder;
import io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor;
-import io.opentelemetry.instrumentation.api.instrumenter.http.HttpClientAttributesGetter;
-import io.opentelemetry.instrumentation.api.instrumenter.http.HttpServerAttributesExtractor;
-import io.opentelemetry.instrumentation.api.instrumenter.http.HttpServerAttributesGetter;
-import io.opentelemetry.instrumentation.api.instrumenter.http.HttpServerRoute;
-import io.opentelemetry.instrumentation.api.instrumenter.http.HttpServerRouteBiGetter;
-import io.opentelemetry.instrumentation.api.instrumenter.http.HttpSpanNameExtractor;
-import io.opentelemetry.instrumentation.api.instrumenter.http.HttpSpanStatusExtractor;
-import io.opentelemetry.semconv.SemanticAttributes;
-import io.quarkus.opentelemetry.runtime.config.runtime.SemconvStabilityType;
+import io.opentelemetry.instrumentation.api.semconv.http.HttpClientAttributesGetter;
+import io.opentelemetry.instrumentation.api.semconv.http.HttpServerAttributesExtractor;
+import io.opentelemetry.instrumentation.api.semconv.http.HttpServerAttributesGetter;
+import io.opentelemetry.instrumentation.api.semconv.http.HttpServerRoute;
+import io.opentelemetry.instrumentation.api.semconv.http.HttpServerRouteBiGetter;
+import io.opentelemetry.instrumentation.api.semconv.http.HttpSpanNameExtractor;
+import io.opentelemetry.instrumentation.api.semconv.http.HttpSpanStatusExtractor;
import io.smallrye.common.vertx.VertxContext;
import io.vertx.core.Context;
import io.vertx.core.MultiMap;
@@ -52,8 +51,8 @@ public class HttpInstrumenterVertxTracer implements InstrumenterVertxTracer serverInstrumenter;
private final Instrumenter clientInstrumenter;
- public HttpInstrumenterVertxTracer(final OpenTelemetry openTelemetry, final SemconvStabilityType semconvStability) {
- serverInstrumenter = getServerInstrumenter(openTelemetry, semconvStability);
+ public HttpInstrumenterVertxTracer(final OpenTelemetry openTelemetry) {
+ serverInstrumenter = getServerInstrumenter(openTelemetry);
clientInstrumenter = getClientInstrumenter(openTelemetry);
}
@@ -137,8 +136,7 @@ public HttpRequest writableHeaders(
return WriteHeadersHttpRequest.request(request, headers);
}
- private static Instrumenter getServerInstrumenter(final OpenTelemetry openTelemetry,
- final SemconvStabilityType semconvStability) {
+ private static Instrumenter getServerInstrumenter(final OpenTelemetry openTelemetry) {
ServerAttributesExtractor serverAttributesExtractor = new ServerAttributesExtractor();
InstrumenterBuilder serverBuilder = Instrumenter.builder(
@@ -150,7 +148,7 @@ private static Instrumenter getServerInstrumenter(fin
.setSpanStatusExtractor(HttpSpanStatusExtractor.create(serverAttributesExtractor))
.addAttributesExtractor(
HttpServerAttributesExtractor.create(serverAttributesExtractor))
- .addAttributesExtractor(new AdditionalServerAttributesExtractor(semconvStability))
+ .addAttributesExtractor(new AdditionalServerAttributesExtractor())
.addContextCustomizer(HttpServerRoute.create(serverAttributesExtractor))
.buildServerInstrumenter(new HttpRequestTextMapGetter());
}
@@ -167,7 +165,7 @@ private static Instrumenter getClientInstrumenter(fin
return clientBuilder
.setSpanStatusExtractor(HttpSpanStatusExtractor.create(serverAttributesExtractor))
.addAttributesExtractor(
- io.opentelemetry.instrumentation.api.instrumenter.http.HttpClientAttributesExtractor.create(
+ io.opentelemetry.instrumentation.api.semconv.http.HttpClientAttributesExtractor.create(
httpClientAttributesExtractor))
.buildClientInstrumenter(new HttpRequestTextMapSetter());
}
@@ -199,12 +197,12 @@ public String get(final io.opentelemetry.context.Context context, final HttpRequ
private static class ServerAttributesExtractor implements HttpServerAttributesGetter {
@Override
- public String getTransport(HttpRequest httpRequest) {
- return null;
+ public String getNetworkProtocolName(HttpRequest request, HttpResponse response) {
+ return "http";
}
@Override
- public String getServerAddress(HttpRequest httpRequest) {
+ public String getNetworkPeerAddress(HttpRequest httpRequest, HttpResponse httpResponse) {
if (httpRequest instanceof HttpServerRequest) {
return VertxUtil.extractRemoteHostname((HttpServerRequest) httpRequest);
}
@@ -212,7 +210,7 @@ public String getServerAddress(HttpRequest httpRequest) {
}
@Override
- public Integer getServerPort(HttpRequest httpRequest) {
+ public Integer getNetworkPeerPort(HttpRequest httpRequest, HttpResponse httpResponse) {
if (httpRequest instanceof HttpServerRequest) {
Long remoteHostPort = VertxUtil.extractRemoteHostPort((HttpServerRequest) httpRequest);
if (remoteHostPort == null) {
@@ -223,16 +221,6 @@ public Integer getServerPort(HttpRequest httpRequest) {
return null;
}
- @Override
- public String getNetworkProtocolName(HttpRequest request, HttpResponse response) {
- return "http";
- }
-
- @Override
- public String getNetworkProtocolVersion(HttpRequest request, HttpResponse response) {
- return getHttpVersion(request);
- }
-
@Override
public String getUrlPath(final HttpRequest request) {
try {
@@ -285,28 +273,9 @@ public Integer getHttpResponseStatusCode(HttpRequest httpRequest, HttpResponse h
public List getHttpResponseHeader(final HttpRequest request, final HttpResponse response, final String name) {
return response != null ? response.headers().getAll(name) : Collections.emptyList();
}
-
- private static Long getContentLength(final MultiMap headers) {
- String contentLength = headers.get(HttpHeaders.CONTENT_LENGTH);
- if (contentLength != null && contentLength.length() > 0) {
- try {
- return Long.valueOf(contentLength);
- } catch (NumberFormatException e) {
- return null;
- }
- } else {
- return null;
- }
- }
}
private static class AdditionalServerAttributesExtractor implements AttributesExtractor {
- private final SemconvStabilityType semconvStability;
-
- public AdditionalServerAttributesExtractor(final SemconvStabilityType semconvStability) {
- this.semconvStability = semconvStability;
- }
-
@Override
public void onStart(
final AttributesBuilder attributes,
@@ -316,18 +285,7 @@ public void onStart(
if (httpRequest instanceof HttpServerRequest) {
String clientIp = VertxUtil.extractClientIP((HttpServerRequest) httpRequest);
if (clientIp != null) {
- switch (semconvStability) {
- case HTTP_OLD:
- attributes.put(HTTP_CLIENT_IP, clientIp);
- break;
- case HTTP_DUP:
- attributes.put(HTTP_CLIENT_IP, clientIp);
- attributes.put(CLIENT_ADDRESS, clientIp);
- break;
- case HTTP:
- attributes.put(CLIENT_ADDRESS, clientIp);
- break;
- }
+ attributes.put(CLIENT_ADDRESS, clientIp);
}
}
}
@@ -339,7 +297,21 @@ public void onEnd(
final HttpRequest httpRequest,
final HttpResponse httpResponse,
final Throwable error) {
+ attributes.put(HTTP_REQUEST_BODY_SIZE, getContentLength(httpRequest.headers()));
+ attributes.put(HTTP_RESPONSE_BODY_SIZE, getContentLength(httpResponse.headers()));
+ }
+ private static Long getContentLength(final MultiMap headers) {
+ String contentLength = headers.get(HttpHeaders.CONTENT_LENGTH);
+ if (contentLength != null && contentLength.length() > 0) {
+ try {
+ return Long.valueOf(contentLength);
+ } catch (NumberFormatException e) {
+ return null;
+ }
+ } else {
+ return null;
+ }
}
}
@@ -385,11 +357,6 @@ public List getHttpResponseHeader(final HttpRequest request, final HttpR
return response.headers().getAll(name);
}
- @Override
- public String getTransport(HttpRequest httpClientRequest, HttpResponse httpClientResponse) {
- return SemanticAttributes.NetTransportValues.IP_TCP;
- }
-
@Override
public String getServerAddress(HttpRequest httpRequest) {
return httpRequest.remoteAddress().hostName();
diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/RedisClientInstrumenterVertxTracer.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/RedisClientInstrumenterVertxTracer.java
index 445cd66c087a4..06c5db88ee48c 100644
--- a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/RedisClientInstrumenterVertxTracer.java
+++ b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/RedisClientInstrumenterVertxTracer.java
@@ -7,13 +7,13 @@
import io.opentelemetry.api.OpenTelemetry;
import io.opentelemetry.api.common.AttributesBuilder;
+import io.opentelemetry.instrumentation.api.incubator.semconv.db.DbClientAttributesExtractor;
+import io.opentelemetry.instrumentation.api.incubator.semconv.db.DbClientAttributesGetter;
+import io.opentelemetry.instrumentation.api.incubator.semconv.db.DbClientSpanNameExtractor;
import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor;
import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
import io.opentelemetry.instrumentation.api.instrumenter.InstrumenterBuilder;
import io.opentelemetry.instrumentation.api.instrumenter.SpanKindExtractor;
-import io.opentelemetry.instrumentation.api.instrumenter.db.DbClientAttributesExtractor;
-import io.opentelemetry.instrumentation.api.instrumenter.db.DbClientAttributesGetter;
-import io.opentelemetry.instrumentation.api.instrumenter.db.DbClientSpanNameExtractor;
import io.opentelemetry.instrumentation.api.internal.AttributesExtractorUtil;
import io.opentelemetry.semconv.SemanticAttributes;
import io.vertx.core.Context;
diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/SqlClientInstrumenterVertxTracer.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/SqlClientInstrumenterVertxTracer.java
index b8bfdda2a408a..527459568968b 100644
--- a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/SqlClientInstrumenterVertxTracer.java
+++ b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/SqlClientInstrumenterVertxTracer.java
@@ -6,10 +6,10 @@
import java.util.function.BiConsumer;
import io.opentelemetry.api.OpenTelemetry;
+import io.opentelemetry.instrumentation.api.incubator.semconv.db.DbClientSpanNameExtractor;
+import io.opentelemetry.instrumentation.api.incubator.semconv.db.SqlClientAttributesExtractor;
import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
import io.opentelemetry.instrumentation.api.instrumenter.InstrumenterBuilder;
-import io.opentelemetry.instrumentation.api.instrumenter.db.DbClientSpanNameExtractor;
-import io.opentelemetry.instrumentation.api.instrumenter.db.SqlClientAttributesExtractor;
import io.vertx.core.Context;
import io.vertx.core.spi.tracing.SpanKind;
import io.vertx.core.spi.tracing.TagExtractor;
@@ -117,7 +117,7 @@ public String connectionString() {
}
static class SqlClientAttributesGetter implements
- io.opentelemetry.instrumentation.api.instrumenter.db.SqlClientAttributesGetter {
+ io.opentelemetry.instrumentation.api.incubator.semconv.db.SqlClientAttributesGetter {
@Override
public String getRawStatement(final QueryTrace queryTrace) {
diff --git a/extensions/opentelemetry/runtime/src/test/java/io/quarkus/opentelemetry/runtime/OpenTelemetryUtilTest.java b/extensions/opentelemetry/runtime/src/test/java/io/quarkus/opentelemetry/runtime/OpenTelemetryUtilTest.java
index 34903c96f90a1..eebe37eee8a85 100644
--- a/extensions/opentelemetry/runtime/src/test/java/io/quarkus/opentelemetry/runtime/OpenTelemetryUtilTest.java
+++ b/extensions/opentelemetry/runtime/src/test/java/io/quarkus/opentelemetry/runtime/OpenTelemetryUtilTest.java
@@ -17,7 +17,6 @@
import io.opentelemetry.context.Context;
import io.opentelemetry.sdk.trace.SdkTracerProvider;
import io.opentelemetry.sdk.trace.SpanProcessor;
-import io.quarkus.opentelemetry.runtime.config.runtime.SemconvStabilityType;
public class OpenTelemetryUtilTest {
@@ -119,16 +118,4 @@ public void testGetSpanData_nullValue() {
Map actual = OpenTelemetryUtil.getSpanData(null);
assertEquals(0, actual.size());
}
-
- @Test
- public void testSemconvOptin() {
- assertEquals(SemconvStabilityType.HTTP_OLD,
- OpenTelemetryUtil.getSemconvStabilityOptin(null));
- assertEquals(SemconvStabilityType.HTTP_OLD,
- OpenTelemetryUtil.getSemconvStabilityOptin(SemconvStabilityType.HTTP_OLD.getValue()));
- assertEquals(SemconvStabilityType.HTTP,
- OpenTelemetryUtil.getSemconvStabilityOptin(SemconvStabilityType.HTTP.getValue()));
- assertEquals(SemconvStabilityType.HTTP_DUP,
- OpenTelemetryUtil.getSemconvStabilityOptin(SemconvStabilityType.HTTP_DUP.getValue()));
- }
}
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 287784eacb258..dbeba5fcf7ff3 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
@@ -15,44 +15,33 @@
import io.opentelemetry.sdk.trace.samplers.Sampler;
import io.opentelemetry.sdk.trace.samplers.SamplingResult;
import io.opentelemetry.semconv.SemanticAttributes;
-import io.quarkus.opentelemetry.runtime.config.runtime.SemconvStabilityType;
class DropTargetsSamplerTest {
@Test
void testDropTargets() {
CountingSampler countingSampler = new CountingSampler();
- SemconvStabilityType semconvStabilityOptin = getSemconvStabilityOptin(
- System.getProperty("quarkus.otel.semconv-stability.opt-in"));
- var sut = new DropTargetsSampler(countingSampler, List.of("/q/swagger-ui", "/q/swagger-ui*"),
- semconvStabilityOptin);
+ var sut = new DropTargetsSampler(countingSampler, List.of("/q/swagger-ui", "/q/swagger-ui*"));
- assertEquals(SamplingResult.recordAndSample(), getShouldSample(sut, "/other", semconvStabilityOptin));
+ assertEquals(SamplingResult.recordAndSample(), getShouldSample(sut, "/other"));
assertEquals(1, countingSampler.count.get());
- assertEquals(SamplingResult.drop(), getShouldSample(sut, "/q/swagger-ui", semconvStabilityOptin));
+ assertEquals(SamplingResult.drop(), getShouldSample(sut, "/q/swagger-ui"));
assertEquals(1, countingSampler.count.get());
- assertEquals(SamplingResult.drop(), getShouldSample(sut, "/q/swagger-ui/", semconvStabilityOptin));
+ assertEquals(SamplingResult.drop(), getShouldSample(sut, "/q/swagger-ui/"));
assertEquals(1, countingSampler.count.get());
- assertEquals(SamplingResult.drop(), getShouldSample(sut, "/q/swagger-ui/whatever", semconvStabilityOptin));
+ assertEquals(SamplingResult.drop(), getShouldSample(sut, "/q/swagger-ui/whatever"));
assertEquals(1, countingSampler.count.get());
- assertEquals(SamplingResult.recordAndSample(), getShouldSample(sut, "/q/test", semconvStabilityOptin));
+ assertEquals(SamplingResult.recordAndSample(), getShouldSample(sut, "/q/test"));
assertEquals(2, countingSampler.count.get());
}
- private static SamplingResult getShouldSample(DropTargetsSampler sut,
- String target,
- SemconvStabilityType semconvStabilityOptin) {
- if (SemconvStabilityType.HTTP.equals(semconvStabilityOptin) ||
- SemconvStabilityType.HTTP_DUP.equals(semconvStabilityOptin)) {
- return sut.shouldSample(null, null, null, SpanKind.SERVER,
- Attributes.of(SemanticAttributes.URL_PATH, target), null);
- }
+ private static SamplingResult getShouldSample(DropTargetsSampler sut, String target) {
return sut.shouldSample(null, null, null, SpanKind.SERVER,
- Attributes.of(SemanticAttributes.HTTP_TARGET, target), null);
+ Attributes.of(SemanticAttributes.URL_PATH, target), null);
}
private static final class CountingSampler implements Sampler {
diff --git a/extensions/quartz/runtime/pom.xml b/extensions/quartz/runtime/pom.xml
index 037f950bd19d5..5b8b60e382cad 100644
--- a/extensions/quartz/runtime/pom.xml
+++ b/extensions/quartz/runtime/pom.xml
@@ -63,7 +63,7 @@