You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2023/03/28 12:19:15 UTC
[camel-quarkus-examples] 01/02: Update observability example for changes in quarkus-opentelemetry
This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch camel-quarkus-main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus-examples.git
commit f428cd63b186edf64f397509eea44d1a015395c9
Author: James Netherton <ja...@gmail.com>
AuthorDate: Tue Mar 28 07:51:49 2023 +0100
Update observability example for changes in quarkus-opentelemetry
---
observability/README.adoc | 6 ++--
observability/pom.xml | 4 ---
.../tracing/LoggingSpanExporterProducer.java | 34 ----------------------
.../src/main/resources/application.properties | 4 +--
4 files changed, 4 insertions(+), 44 deletions(-)
diff --git a/observability/README.adoc b/observability/README.adoc
index 2f2aee7..48bbb77 100644
--- a/observability/README.adoc
+++ b/observability/README.adoc
@@ -60,8 +60,8 @@ The default configuration uses the OTLP exporter, but it can be easily switched
[source,shell]
----
-- quarkus.opentelemetry.tracer.exporter.otlp.endpoint=http://localhost:4317
-+ quarkus.opentelemetry.tracer.exporter.jaeger.endpoint=http://localhost:14250
+- quarkus.otel.exporter.otlp.traces.endpoint=http://localhost:4317
++ quarkus.otel.exporter.jaeger.traces.endpoint=http://localhost:14250
----
and this change in `pom.xml`:
@@ -88,8 +88,6 @@ With the server running, browse to http://localhost:16686. Then choose 'camel-qu
The `platform-http` consumer route introduces a random delay to simulate latency, hence the overall time of each trace should be different. When viewing a trace, you should see
a hierarchy of 3 spans showing the progression of the message exchange through each endpoint.
-For convenience, tracing events are also logged to the application console.
-
=== Package and run the application
Once you are done with developing you may want to package and run the application.
diff --git a/observability/pom.xml b/observability/pom.xml
index d63b9ce..dded459 100644
--- a/observability/pom.xml
+++ b/observability/pom.xml
@@ -102,10 +102,6 @@
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
- <dependency>
- <groupId>io.opentelemetry</groupId>
- <artifactId>opentelemetry-exporter-logging</artifactId>
- </dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy</artifactId>
diff --git a/observability/src/main/java/org/acme/observability/tracing/LoggingSpanExporterProducer.java b/observability/src/main/java/org/acme/observability/tracing/LoggingSpanExporterProducer.java
deleted file mode 100644
index ada51c2..0000000
--- a/observability/src/main/java/org/acme/observability/tracing/LoggingSpanExporterProducer.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.acme.observability.tracing;
-
-import io.opentelemetry.exporter.logging.LoggingSpanExporter;
-import io.opentelemetry.sdk.trace.export.SpanExporter;
-import jakarta.enterprise.inject.Produces;
-
-/**
- * Quarkus OpenTelemetry automatically discovers and configures SpanExporter beans at build time.
- *
- * The LoggingSpanExporter outputs span details to the application console.
- */
-public class LoggingSpanExporterProducer {
-
- @Produces
- public SpanExporter loggingSpanExporter() {
- return new LoggingSpanExporter();
- }
-}
diff --git a/observability/src/main/resources/application.properties b/observability/src/main/resources/application.properties
index 66fde5c..a0956de 100644
--- a/observability/src/main/resources/application.properties
+++ b/observability/src/main/resources/application.properties
@@ -24,9 +24,9 @@ quarkus.banner.enabled = false
quarkus.application.name=camel-quarkus-observability
# For OTLP
-quarkus.opentelemetry.tracer.exporter.otlp.endpoint=http://${TELEMETRY_COLLECTOR_COLLECTOR_SERVICE_HOST:localhost}:4317
+quarkus.otel.exporter.otlp.traces.endpoint=http://${TELEMETRY_COLLECTOR_COLLECTOR_SERVICE_HOST:localhost}:4317
# For Jaeger
-# quarkus.opentelemetry.tracer.exporter.jaeger.endpoint=http://${MY_JAEGER_COLLECTOR_SERVICE_HOST:localhost}:14250
+# quarkus.otel.exporter.jaeger.traces.endpoint=http://${MY_JAEGER_COLLECTOR_SERVICE_HOST:localhost}:14250
# Allow metrics to be exported as JSON. Not strictly required and is disabled by default
quarkus.micrometer.export.json.enabled = true