Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
<resteasy-microprofile.version>3.0.1.Final</resteasy-microprofile.version>
<resteasy-spring-web.version>3.2.0.Final</resteasy-spring-web.version>
<resteasy.version>6.2.12.Final</resteasy.version>
<opentelemetry-instrumentation.version>2.15.0-alpha</opentelemetry-instrumentation.version> <!-- OTel SDk 1.49.0-->
<opentelemetry-semconv.version>1.32.0-alpha</opentelemetry-semconv.version>
<opentelemetry-instrumentation.version>2.21.0-alpha</opentelemetry-instrumentation.version> <!-- OTel SDk 1.55.0-->
<opentelemetry-semconv.version>1.37.0-alpha</opentelemetry-semconv.version>
<quarkus-http.version>5.3.5</quarkus-http.version>
<micrometer.version>1.14.7</micrometer.version><!-- keep in sync with hdrhistogram: https://central.sonatype.com/artifact/io.micrometer/micrometer-core -->
<hdrhistogram.version>2.2.2</hdrhistogram.version><!-- keep in sync with micrometer -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.quarkus.opentelemetry.runtime.exporter.otlp;

import static io.quarkus.opentelemetry.runtime.config.build.ExporterType.Constants.OTLP_VALUE;
import static io.opentelemetry.sdk.internal.StandardComponentId.ExporterType.OTLP_GRPC_METRIC_EXPORTER;
import static io.quarkus.opentelemetry.runtime.config.runtime.exporter.OtlpExporterConfig.Protocol.GRPC;
import static io.quarkus.opentelemetry.runtime.config.runtime.exporter.OtlpExporterConfig.Protocol.HTTP_PROTOBUF;
import static io.quarkus.opentelemetry.runtime.config.runtime.exporter.OtlpExporterRuntimeConfig.DEFAULT_GRPC_BASE_URI;
Expand All @@ -27,6 +27,9 @@
import io.opentelemetry.exporter.internal.otlp.traces.TraceRequestMarshaler;
import io.opentelemetry.exporter.otlp.internal.OtlpUserAgent;
import io.opentelemetry.sdk.autoconfigure.spi.ConfigurationException;
import io.opentelemetry.sdk.common.InternalTelemetryVersion;
import io.opentelemetry.sdk.internal.ComponentId;
import io.opentelemetry.sdk.internal.StandardComponentId;
import io.opentelemetry.sdk.logs.export.LogRecordExporter;
import io.opentelemetry.sdk.metrics.Aggregation;
import io.opentelemetry.sdk.metrics.InstrumentType;
Expand All @@ -43,7 +46,12 @@
import io.quarkus.opentelemetry.runtime.config.build.OTelBuildConfig;
import io.quarkus.opentelemetry.runtime.config.runtime.BatchSpanProcessorConfig;
import io.quarkus.opentelemetry.runtime.config.runtime.OTelRuntimeConfig;
import io.quarkus.opentelemetry.runtime.config.runtime.exporter.*;
import io.quarkus.opentelemetry.runtime.config.runtime.exporter.CompressionType;
import io.quarkus.opentelemetry.runtime.config.runtime.exporter.OtlpExporterConfig;
import io.quarkus.opentelemetry.runtime.config.runtime.exporter.OtlpExporterLogsConfig;
import io.quarkus.opentelemetry.runtime.config.runtime.exporter.OtlpExporterMetricsConfig;
import io.quarkus.opentelemetry.runtime.config.runtime.exporter.OtlpExporterRuntimeConfig;
import io.quarkus.opentelemetry.runtime.config.runtime.exporter.OtlpExporterTracesConfig;
import io.quarkus.opentelemetry.runtime.exporter.otlp.logs.NoopLogRecordExporter;
import io.quarkus.opentelemetry.runtime.exporter.otlp.logs.VertxGrpcLogRecordExporter;
import io.quarkus.opentelemetry.runtime.exporter.otlp.logs.VertxHttpLogRecordExporter;
Expand Down Expand Up @@ -105,6 +113,7 @@ public LateBoundSpanProcessor apply(
try {
TlsConfigurationRegistry tlsConfigurationRegistry = context
.getInjectedReference(TlsConfigurationRegistry.class);

var spanExporter = createSpanExporter(exporterRuntimeConfig.getValue(), vertx.get(), baseUri,
tlsConfigurationRegistry);

Expand Down Expand Up @@ -140,9 +149,11 @@ private SpanExporter createSpanExporter(OtlpExporterRuntimeConfig exporterRuntim

String protocol = tracesConfig.protocol().get();
if (GRPC.equals(protocol)) {
return createOtlpGrpcSpanExporter(exporterRuntimeConfig, vertx, baseUri, tlsConfigurationRegistry);
return createOtlpGrpcSpanExporter(exporterRuntimeConfig, vertx, baseUri,
tlsConfigurationRegistry);
} else if (HTTP_PROTOBUF.equals(protocol)) {
return createHttpSpanExporter(exporterRuntimeConfig, vertx, baseUri, protocol, tlsConfigurationRegistry);
return createHttpSpanExporter(exporterRuntimeConfig, vertx, baseUri, protocol,
tlsConfigurationRegistry);
}

throw new IllegalArgumentException(String.format("Unsupported OTLP protocol %s specified. " +
Expand All @@ -156,8 +167,6 @@ private SpanExporter createOtlpGrpcSpanExporter(OtlpExporterRuntimeConfig export
OtlpExporterTracesConfig tracesConfig = exporterRuntimeConfig.traces();

return new VertxGrpcSpanExporter(new GrpcExporter<TraceRequestMarshaler>(
OTLP_VALUE, // use the same as OTel does
"span", // use the same as OTel does
new VertxGrpcSender(
baseUri,
VertxGrpcSender.GRPC_TRACE_SERVICE_NAME,
Expand All @@ -166,7 +175,10 @@ private SpanExporter createOtlpGrpcSpanExporter(OtlpExporterRuntimeConfig export
populateTracingExportHttpHeaders(tracesConfig),
new HttpClientOptionsConsumer(tracesConfig, baseUri, tlsConfigurationRegistry),
vertx),
MeterProvider::noop));
InternalTelemetryVersion.LATEST,
ComponentId.generateLazy(StandardComponentId.ExporterType.OTLP_GRPC_SPAN_EXPORTER), // use the same as OTel does
MeterProvider::noop,
baseUri.toASCIIString()));
}

private SpanExporter createHttpSpanExporter(OtlpExporterRuntimeConfig exporterRuntimeConfig, Vertx vertx,
Expand All @@ -178,8 +190,7 @@ private SpanExporter createHttpSpanExporter(OtlpExporterRuntimeConfig exporterRu
boolean exportAsJson = false; //TODO: this will be enhanced in the future

return new VertxHttpSpanExporter(new HttpExporter<TraceRequestMarshaler>(
OTLP_VALUE, // use the same as OTel does
"span", // use the same as OTel does
ComponentId.generateLazy(StandardComponentId.ExporterType.OTLP_HTTP_SPAN_EXPORTER),
new VertxHttpSender(
baseUri,
VertxHttpSender.TRACES_PATH,
Expand All @@ -190,7 +201,8 @@ private SpanExporter createHttpSpanExporter(OtlpExporterRuntimeConfig exporterRu
new HttpClientOptionsConsumer(tracesConfig, baseUri, tlsConfigurationRegistry),
vertx),
MeterProvider::noop,
exportAsJson));
InternalTelemetryVersion.LATEST,
baseUri.toASCIIString()));
}
};
}
Expand Down Expand Up @@ -222,8 +234,6 @@ public MetricExporter apply(SyntheticCreationalContext<MetricExporter> context)
if (GRPC.equals(protocol)) {
metricExporter = new VertxGrpcMetricExporter(
new GrpcExporter<MetricsRequestMarshaler>(
OTLP_VALUE, // use the same as OTel does
"metric", // use the same as OTel does
new VertxGrpcSender(
baseUri,
VertxGrpcSender.GRPC_METRIC_SERVICE_NAME,
Expand All @@ -232,15 +242,18 @@ public MetricExporter apply(SyntheticCreationalContext<MetricExporter> context)
populateTracingExportHttpHeaders(metricsConfig),
new HttpClientOptionsConsumer(metricsConfig, baseUri, tlsConfigurationRegistry),
vertx.get()),
MeterProvider::noop),
InternalTelemetryVersion.LATEST,
ComponentId.generateLazy(OTLP_GRPC_METRIC_EXPORTER), // use the same as OTel does
MeterProvider::noop,
baseUri.toASCIIString()),
aggregationTemporalityResolver(metricsConfig),
aggregationResolver(metricsConfig));
} else if (HTTP_PROTOBUF.equals(protocol)) {
boolean exportAsJson = false; //TODO: this will be enhanced in the future
metricExporter = new VertxHttpMetricsExporter(
new HttpExporter<MetricsRequestMarshaler>(
OTLP_VALUE, // use the same as OTel does
"metric", // use the same as OTel does
ComponentId.generateLazy(
StandardComponentId.ExporterType.OTLP_HTTP_METRIC_EXPORTER),
new VertxHttpSender(
baseUri,
VertxHttpSender.METRICS_PATH,
Expand All @@ -251,7 +264,8 @@ public MetricExporter apply(SyntheticCreationalContext<MetricExporter> context)
new HttpClientOptionsConsumer(metricsConfig, baseUri, tlsConfigurationRegistry),
vertx.get()),
MeterProvider::noop,
exportAsJson),
InternalTelemetryVersion.LATEST,
baseUri.toASCIIString()),
aggregationTemporalityResolver(metricsConfig),
aggregationResolver(metricsConfig));
} else {
Expand Down Expand Up @@ -294,8 +308,6 @@ public LogRecordExporter apply(SyntheticCreationalContext<LogRecordExporter> con
if (GRPC.equals(protocol)) {
logRecordExporter = new VertxGrpcLogRecordExporter(
new GrpcExporter<LogsRequestMarshaler>(
OTLP_VALUE, // use the same as OTel does
"log", // use the same as OTel does
new VertxGrpcSender(
baseUri,
VertxGrpcSender.GRPC_LOG_SERVICE_NAME,
Expand All @@ -304,13 +316,17 @@ public LogRecordExporter apply(SyntheticCreationalContext<LogRecordExporter> con
populateTracingExportHttpHeaders(logsConfig),
new HttpClientOptionsConsumer(logsConfig, baseUri, tlsConfigurationRegistry),
vertx.get()),
MeterProvider::noop));
InternalTelemetryVersion.LATEST,
ComponentId.generateLazy(
StandardComponentId.ExporterType.OTLP_GRPC_LOG_EXPORTER), // use the same as OTel does
MeterProvider::noop,
baseUri.toASCIIString()));
} else if (HTTP_PROTOBUF.equals(protocol)) {
boolean exportAsJson = false; //TODO: this will be enhanced in the future
logRecordExporter = new VertxHttpLogRecordExporter(
new HttpExporter<LogsRequestMarshaler>(
OTLP_VALUE, // use the same as OTel does
"log", // use the same as OTel does
ComponentId.generateLazy(
StandardComponentId.ExporterType.OTLP_HTTP_LOG_EXPORTER),
new VertxHttpSender(
baseUri,
VertxHttpSender.LOGS_PATH,
Expand All @@ -321,7 +337,8 @@ public LogRecordExporter apply(SyntheticCreationalContext<LogRecordExporter> con
new HttpClientOptionsConsumer(logsConfig, baseUri, tlsConfigurationRegistry),
vertx.get()),
MeterProvider::noop,
exportAsJson));
InternalTelemetryVersion.LATEST,
baseUri.toASCIIString()));
} else {
throw new IllegalArgumentException(String.format("Unsupported OTLP protocol %s specified. " +
"Please check `quarkus.otel.exporter.otlp.logs.protocol` property", protocol));
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
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.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.SpanNameExtractor;
import io.opentelemetry.instrumentation.api.semconv.util.SpanNames;
import io.quarkus.arc.ArcInvocationContext;
import io.quarkus.opentelemetry.runtime.config.runtime.OTelRuntimeConfig;
import io.smallrye.mutiny.Multi;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public String getUser(CommandTrace commandTrace) {

@Override
public String getDbNamespace(CommandTrace commandTrace) {
return DbClientAttributesGetter.super.getDbNamespace(commandTrace);
return null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this wrong before ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returning null is odd indeed. If that's what we want to do, maybe a comment would help.

Copy link
Contributor Author

@brunobat brunobat Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method was removed...
Effectively, the previous code was returning null.
Null means it will not output that attribute.

}

// kept for compatibility reasons
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/opentelemetry-spi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<name>Quarkus - Integration Tests - OpenTelemetry SPI</name>

<properties>
<opentelemetry-aws-xray-propagator.version>1.43.0-alpha</opentelemetry-aws-xray-propagator.version>
<opentelemetry-aws-xray-propagator.version>1.51.0-alpha</opentelemetry-aws-xray-propagator.version>
</properties>


Expand Down
Loading