Skip to content

Commit bcc4ff5

Browse files
committed
Upgrade to opentelemetry-instrumentation.version>2.21.0-alpha
1 parent 3144e47 commit bcc4ff5

File tree

6 files changed

+44
-41
lines changed

6 files changed

+44
-41
lines changed

bom/application/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
<resteasy-microprofile.version>3.0.1.Final</resteasy-microprofile.version>
3030
<resteasy-spring-web.version>3.2.0.Final</resteasy-spring-web.version>
3131
<resteasy.version>6.2.12.Final</resteasy.version>
32-
<opentelemetry-instrumentation.version>2.15.0-alpha</opentelemetry-instrumentation.version> <!-- OTel SDk 1.49.0-->
33-
<opentelemetry-semconv.version>1.32.0-alpha</opentelemetry-semconv.version>
32+
<opentelemetry-instrumentation.version>2.21.0-alpha</opentelemetry-instrumentation.version> <!-- OTel SDk 1.55.0-->
33+
<opentelemetry-semconv.version>1.37.0-alpha</opentelemetry-semconv.version>
3434
<quarkus-http.version>5.3.5</quarkus-http.version>
3535
<micrometer.version>1.14.7</micrometer.version><!-- keep in sync with hdrhistogram: https://central.sonatype.com/artifact/io.micrometer/micrometer-core -->
3636
<hdrhistogram.version>2.2.2</hdrhistogram.version><!-- keep in sync with micrometer -->

extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/exporter/otlp/OTelExporterRecorder.java

Lines changed: 39 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package io.quarkus.opentelemetry.runtime.exporter.otlp;
22

3-
import static io.quarkus.opentelemetry.runtime.config.build.ExporterType.Constants.OTLP_VALUE;
3+
import static io.opentelemetry.sdk.internal.StandardComponentId.ExporterType.OTLP_GRPC_METRIC_EXPORTER;
44
import static io.quarkus.opentelemetry.runtime.config.runtime.exporter.OtlpExporterConfig.Protocol.GRPC;
55
import static io.quarkus.opentelemetry.runtime.config.runtime.exporter.OtlpExporterConfig.Protocol.HTTP_PROTOBUF;
66
import static io.quarkus.opentelemetry.runtime.config.runtime.exporter.OtlpExporterRuntimeConfig.DEFAULT_GRPC_BASE_URI;
@@ -27,6 +27,9 @@
2727
import io.opentelemetry.exporter.internal.otlp.traces.TraceRequestMarshaler;
2828
import io.opentelemetry.exporter.otlp.internal.OtlpUserAgent;
2929
import io.opentelemetry.sdk.autoconfigure.spi.ConfigurationException;
30+
import io.opentelemetry.sdk.common.InternalTelemetryVersion;
31+
import io.opentelemetry.sdk.internal.ComponentId;
32+
import io.opentelemetry.sdk.internal.StandardComponentId;
3033
import io.opentelemetry.sdk.logs.export.LogRecordExporter;
3134
import io.opentelemetry.sdk.metrics.Aggregation;
3235
import io.opentelemetry.sdk.metrics.InstrumentType;
@@ -43,7 +46,12 @@
4346
import io.quarkus.opentelemetry.runtime.config.build.OTelBuildConfig;
4447
import io.quarkus.opentelemetry.runtime.config.runtime.BatchSpanProcessorConfig;
4548
import io.quarkus.opentelemetry.runtime.config.runtime.OTelRuntimeConfig;
46-
import io.quarkus.opentelemetry.runtime.config.runtime.exporter.*;
49+
import io.quarkus.opentelemetry.runtime.config.runtime.exporter.CompressionType;
50+
import io.quarkus.opentelemetry.runtime.config.runtime.exporter.OtlpExporterConfig;
51+
import io.quarkus.opentelemetry.runtime.config.runtime.exporter.OtlpExporterLogsConfig;
52+
import io.quarkus.opentelemetry.runtime.config.runtime.exporter.OtlpExporterMetricsConfig;
53+
import io.quarkus.opentelemetry.runtime.config.runtime.exporter.OtlpExporterRuntimeConfig;
54+
import io.quarkus.opentelemetry.runtime.config.runtime.exporter.OtlpExporterTracesConfig;
4755
import io.quarkus.opentelemetry.runtime.exporter.otlp.logs.NoopLogRecordExporter;
4856
import io.quarkus.opentelemetry.runtime.exporter.otlp.logs.VertxGrpcLogRecordExporter;
4957
import io.quarkus.opentelemetry.runtime.exporter.otlp.logs.VertxHttpLogRecordExporter;
@@ -105,6 +113,7 @@ public LateBoundSpanProcessor apply(
105113
try {
106114
TlsConfigurationRegistry tlsConfigurationRegistry = context
107115
.getInjectedReference(TlsConfigurationRegistry.class);
116+
108117
var spanExporter = createSpanExporter(exporterRuntimeConfig.getValue(), vertx.get(), baseUri,
109118
tlsConfigurationRegistry);
110119

@@ -140,9 +149,11 @@ private SpanExporter createSpanExporter(OtlpExporterRuntimeConfig exporterRuntim
140149

141150
String protocol = tracesConfig.protocol().get();
142151
if (GRPC.equals(protocol)) {
143-
return createOtlpGrpcSpanExporter(exporterRuntimeConfig, vertx, baseUri, tlsConfigurationRegistry);
152+
return createOtlpGrpcSpanExporter(exporterRuntimeConfig, vertx, baseUri,
153+
tlsConfigurationRegistry);
144154
} else if (HTTP_PROTOBUF.equals(protocol)) {
145-
return createHttpSpanExporter(exporterRuntimeConfig, vertx, baseUri, protocol, tlsConfigurationRegistry);
155+
return createHttpSpanExporter(exporterRuntimeConfig, vertx, baseUri, protocol,
156+
tlsConfigurationRegistry);
146157
}
147158

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

158169
return new VertxGrpcSpanExporter(new GrpcExporter<TraceRequestMarshaler>(
159-
OTLP_VALUE, // use the same as OTel does
160-
"span", // use the same as OTel does
161170
new VertxGrpcSender(
162171
baseUri,
163172
VertxGrpcSender.GRPC_TRACE_SERVICE_NAME,
@@ -166,7 +175,10 @@ private SpanExporter createOtlpGrpcSpanExporter(OtlpExporterRuntimeConfig export
166175
populateTracingExportHttpHeaders(tracesConfig),
167176
new HttpClientOptionsConsumer(tracesConfig, baseUri, tlsConfigurationRegistry),
168177
vertx),
169-
MeterProvider::noop));
178+
InternalTelemetryVersion.LATEST,
179+
ComponentId.generateLazy(StandardComponentId.ExporterType.OTLP_GRPC_SPAN_EXPORTER), // use the same as OTel does
180+
MeterProvider::noop,
181+
baseUri.toASCIIString()));
170182
}
171183

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

180192
return new VertxHttpSpanExporter(new HttpExporter<TraceRequestMarshaler>(
181-
OTLP_VALUE, // use the same as OTel does
182-
"span", // use the same as OTel does
193+
ComponentId.generateLazy(StandardComponentId.ExporterType.OTLP_HTTP_SPAN_EXPORTER),
183194
new VertxHttpSender(
184195
baseUri,
185196
VertxHttpSender.TRACES_PATH,
@@ -190,7 +201,8 @@ private SpanExporter createHttpSpanExporter(OtlpExporterRuntimeConfig exporterRu
190201
new HttpClientOptionsConsumer(tracesConfig, baseUri, tlsConfigurationRegistry),
191202
vertx),
192203
MeterProvider::noop,
193-
exportAsJson));
204+
InternalTelemetryVersion.LATEST,
205+
baseUri.toASCIIString()));
194206
}
195207
};
196208
}
@@ -222,8 +234,6 @@ public MetricExporter apply(SyntheticCreationalContext<MetricExporter> context)
222234
if (GRPC.equals(protocol)) {
223235
metricExporter = new VertxGrpcMetricExporter(
224236
new GrpcExporter<MetricsRequestMarshaler>(
225-
OTLP_VALUE, // use the same as OTel does
226-
"metric", // use the same as OTel does
227237
new VertxGrpcSender(
228238
baseUri,
229239
VertxGrpcSender.GRPC_METRIC_SERVICE_NAME,
@@ -232,15 +242,18 @@ public MetricExporter apply(SyntheticCreationalContext<MetricExporter> context)
232242
populateTracingExportHttpHeaders(metricsConfig),
233243
new HttpClientOptionsConsumer(metricsConfig, baseUri, tlsConfigurationRegistry),
234244
vertx.get()),
235-
MeterProvider::noop),
245+
InternalTelemetryVersion.LATEST,
246+
ComponentId.generateLazy(OTLP_GRPC_METRIC_EXPORTER), // use the same as OTel does
247+
MeterProvider::noop,
248+
baseUri.toASCIIString()),
236249
aggregationTemporalityResolver(metricsConfig),
237250
aggregationResolver(metricsConfig));
238251
} else if (HTTP_PROTOBUF.equals(protocol)) {
239252
boolean exportAsJson = false; //TODO: this will be enhanced in the future
240253
metricExporter = new VertxHttpMetricsExporter(
241254
new HttpExporter<MetricsRequestMarshaler>(
242-
OTLP_VALUE, // use the same as OTel does
243-
"metric", // use the same as OTel does
255+
ComponentId.generateLazy(
256+
StandardComponentId.ExporterType.OTLP_HTTP_METRIC_EXPORTER),
244257
new VertxHttpSender(
245258
baseUri,
246259
VertxHttpSender.METRICS_PATH,
@@ -251,7 +264,8 @@ public MetricExporter apply(SyntheticCreationalContext<MetricExporter> context)
251264
new HttpClientOptionsConsumer(metricsConfig, baseUri, tlsConfigurationRegistry),
252265
vertx.get()),
253266
MeterProvider::noop,
254-
exportAsJson),
267+
InternalTelemetryVersion.LATEST,
268+
baseUri.toASCIIString()),
255269
aggregationTemporalityResolver(metricsConfig),
256270
aggregationResolver(metricsConfig));
257271
} else {
@@ -294,8 +308,6 @@ public LogRecordExporter apply(SyntheticCreationalContext<LogRecordExporter> con
294308
if (GRPC.equals(protocol)) {
295309
logRecordExporter = new VertxGrpcLogRecordExporter(
296310
new GrpcExporter<LogsRequestMarshaler>(
297-
OTLP_VALUE, // use the same as OTel does
298-
"log", // use the same as OTel does
299311
new VertxGrpcSender(
300312
baseUri,
301313
VertxGrpcSender.GRPC_LOG_SERVICE_NAME,
@@ -304,13 +316,17 @@ public LogRecordExporter apply(SyntheticCreationalContext<LogRecordExporter> con
304316
populateTracingExportHttpHeaders(logsConfig),
305317
new HttpClientOptionsConsumer(logsConfig, baseUri, tlsConfigurationRegistry),
306318
vertx.get()),
307-
MeterProvider::noop));
319+
InternalTelemetryVersion.LATEST,
320+
ComponentId.generateLazy(
321+
StandardComponentId.ExporterType.OTLP_GRPC_LOG_EXPORTER), // use the same as OTel does
322+
MeterProvider::noop,
323+
baseUri.toASCIIString()));
308324
} else if (HTTP_PROTOBUF.equals(protocol)) {
309325
boolean exportAsJson = false; //TODO: this will be enhanced in the future
310326
logRecordExporter = new VertxHttpLogRecordExporter(
311327
new HttpExporter<LogsRequestMarshaler>(
312-
OTLP_VALUE, // use the same as OTel does
313-
"log", // use the same as OTel does
328+
ComponentId.generateLazy(
329+
StandardComponentId.ExporterType.OTLP_HTTP_LOG_EXPORTER),
314330
new VertxHttpSender(
315331
baseUri,
316332
VertxHttpSender.LOGS_PATH,
@@ -321,7 +337,8 @@ public LogRecordExporter apply(SyntheticCreationalContext<LogRecordExporter> con
321337
new HttpClientOptionsConsumer(logsConfig, baseUri, tlsConfigurationRegistry),
322338
vertx.get()),
323339
MeterProvider::noop,
324-
exportAsJson));
340+
InternalTelemetryVersion.LATEST,
341+
baseUri.toASCIIString()));
325342
} else {
326343
throw new IllegalArgumentException(String.format("Unsupported OTLP protocol %s specified. " +
327344
"Please check `quarkus.otel.exporter.otlp.logs.protocol` property", protocol));

extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/graal/UnsafeRefArrayAccess.java

Lines changed: 0 additions & 14 deletions
This file was deleted.

extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/cdi/WithSpanInterceptor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424
import io.opentelemetry.instrumentation.annotations.WithSpan;
2525
import io.opentelemetry.instrumentation.api.annotation.support.MethodSpanAttributesExtractor;
2626
import io.opentelemetry.instrumentation.api.annotation.support.ParameterAttributeNamesExtractor;
27-
import io.opentelemetry.instrumentation.api.incubator.semconv.util.SpanNames;
2827
import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor;
2928
import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
3029
import io.opentelemetry.instrumentation.api.instrumenter.InstrumenterBuilder;
3130
import io.opentelemetry.instrumentation.api.instrumenter.SpanKindExtractor;
3231
import io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor;
32+
import io.opentelemetry.instrumentation.api.semconv.util.SpanNames;
3333
import io.quarkus.arc.ArcInvocationContext;
3434
import io.quarkus.opentelemetry.runtime.config.runtime.OTelRuntimeConfig;
3535
import io.smallrye.mutiny.Multi;

extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/RedisClientInstrumenterVertxTracer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ public String getUser(CommandTrace commandTrace) {
194194

195195
@Override
196196
public String getDbNamespace(CommandTrace commandTrace) {
197-
return DbClientAttributesGetter.super.getDbNamespace(commandTrace);
197+
return null;
198198
}
199199

200200
// kept for compatibility reasons

integration-tests/opentelemetry-spi/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<name>Quarkus - Integration Tests - OpenTelemetry SPI</name>
1616

1717
<properties>
18-
<opentelemetry-aws-xray-propagator.version>1.43.0-alpha</opentelemetry-aws-xray-propagator.version>
18+
<opentelemetry-aws-xray-propagator.version>1.51.0-alpha</opentelemetry-aws-xray-propagator.version>
1919
</properties>
2020

2121

0 commit comments

Comments
 (0)