This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/main by this push:
new cfd14e50dc Add camel-quarkus-micrometer-observability extension with
native support
cfd14e50dc is described below
commit cfd14e50dced8d47fde216bcee10da5818eb8747
Author: JinyuChen97 <[email protected]>
AuthorDate: Mon Jul 27 10:34:24 2026 +0100
Add camel-quarkus-micrometer-observability extension with native support
Adds a new Quarkus extension for camel-micrometer-observability, bridging
Camel's telemetry SPI to Micrometer Tracing via the OTel bridge.
Extension (runtime):
- MicrometerObservabilityTracerProducer: CDI @DefaultBean producer that
bridges
from the Quarkus-provided OpenTelemetry bean to Micrometer Tracing by
constructing OtelTracer, OtelPropagator and ObservationRegistry.
- CamelMicrometerObservabilityConfig: five Quarkus config properties under
quarkus.camel.micrometer-observability.
- Runtime dependencies: quarkus-opentelemetry,
micrometer-tracing-bridge-otel.
Extension (deployment):
- MicrometerObservabilityProcessor: three BuildSteps — FeatureBuildItem,
AdditionalBeanBuildItem (producer unremovable), UnremovableBeanBuildItem
(Camel Tracer bean).
Integration tests (JVM + Native, 4 tests):
- testSpansAreGenerated: verifies the full pipeline
Camel → MicrometerObservabilityTracer → OtelTracer bridge → OTel SDK →
InMemorySpanExporter.
- testExcludePatternsAreApplied: verifies exclude-patterns suppresses spans
for matching endpoints.
- testConfigPropertiesAreWired: verifies all five config properties are
correctly propagated to the live MicrometerObservabilityTracer via
CamelMicrometerObservabilityConfig.
- testUpstreamW3CTracePropagation: verifies W3C traceparent propagation
using the real OTel propagator.
Test infrastructure uses InMemorySpanExporter (opentelemetry-sdk-testing)
for validating the full OTel pipeline.
Added micrometer-tracing and micrometer-tracing-bridge-otel to
camel-quarkus-bom with fixed version to root pom.xml
Co-authored-by: Bob <[email protected]>
---
catalog/pom.xml | 13 ++
.../examples/others/micrometer-observability.yml | 13 ++
docs/modules/ROOT/nav.adoc | 1 +
.../extensions/micrometer-observability.adoc | 118 ++++++++++++++++
.../micrometer-observability/deployment/pom.xml | 72 ++++++++++
.../MicrometerObservabilityProcessor.java | 48 +++++++
extensions/micrometer-observability/pom.xml | 39 +++++
.../micrometer-observability/runtime/pom.xml | 109 ++++++++++++++
.../runtime/src/main/doc/usage.adoc | 15 ++
.../CamelMicrometerObservabilityConfig.java | 77 ++++++++++
.../MicrometerObservabilityTracerProducer.java | 81 +++++++++++
.../main/resources/META-INF/quarkus-extension.yaml | 38 +++++
extensions/pom.xml | 1 +
integration-tests/micrometer-observability/pom.xml | 142 +++++++++++++++++++
.../it/MicrometerObservabilityResource.java | 64 +++++++++
.../it/MicrometerObservabilityRoutes.java | 36 +++++
.../observability/it/SpanExporterProducer.java | 32 +++++
.../observability/it/SpanExporterResource.java | 97 +++++++++++++
.../src/main/resources/application.properties | 26 ++++
.../it/MicrometerObservabilityIT.java | 24 ++++
.../it/MicrometerObservabilityTest.java | 157 +++++++++++++++++++++
integration-tests/pom.xml | 1 +
pom.xml | 1 +
poms/bom/pom.xml | 25 ++++
poms/bom/src/main/generated/flattened-full-pom.xml | 25 ++++
.../src/main/generated/flattened-reduced-pom.xml | 25 ++++
.../generated/flattened-reduced-verbose-pom.xml | 25 ++++
tooling/scripts/test-categories.yaml | 1 +
28 files changed, 1306 insertions(+)
diff --git a/catalog/pom.xml b/catalog/pom.xml
index 51b8842e25..e6b89cf2e1 100644
--- a/catalog/pom.xml
+++ b/catalog/pom.xml
@@ -2840,6 +2840,19 @@
</exclusion>
</exclusions>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-micrometer-observability</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-microprofile-fault-tolerance</artifactId>
diff --git a/docs/modules/ROOT/examples/others/micrometer-observability.yml
b/docs/modules/ROOT/examples/others/micrometer-observability.yml
new file mode 100644
index 0000000000..110e7c9f90
--- /dev/null
+++ b/docs/modules/ROOT/examples/others/micrometer-observability.yml
@@ -0,0 +1,13 @@
+# Do not edit directly!
+# This file was generated by
camel-quarkus-maven-plugin:update-extension-doc-page
+cqArtifactId: camel-quarkus-micrometer-observability
+cqArtifactIdBase: micrometer-observability
+cqNativeSupported: true
+cqStatus: Stable
+cqDeprecated: false
+cqJvmSince: 3.38.0
+cqNativeSince: 3.38.0
+cqCamelPartName: micrometer-observability
+cqCamelPartTitle: Micrometer Observability 2
+cqCamelPartDescription: Micrometer Observability implementation of Camel
Telemetry
+cqExtensionPageTitle: Micrometer Observability 2
diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc
index bb0ffd2c66..db466c825d 100644
--- a/docs/modules/ROOT/nav.adoc
+++ b/docs/modules/ROOT/nav.adoc
@@ -236,6 +236,7 @@
*** xref:reference/extensions/mdc.adoc[Mdc]
*** xref:reference/extensions/microprofile-health.adoc[MicroProfile Health]
*** xref:reference/extensions/micrometer.adoc[Micrometer]
+*** xref:reference/extensions/micrometer-observability.adoc[Micrometer
Observability 2]
*** xref:reference/extensions/microprofile-fault-tolerance.adoc[Microprofile
Fault Tolerance]
*** xref:reference/extensions/milvus.adoc[Milvus]
*** xref:reference/extensions/minio.adoc[Minio]
diff --git
a/docs/modules/ROOT/pages/reference/extensions/micrometer-observability.adoc
b/docs/modules/ROOT/pages/reference/extensions/micrometer-observability.adoc
new file mode 100644
index 0000000000..b957093b8b
--- /dev/null
+++ b/docs/modules/ROOT/pages/reference/extensions/micrometer-observability.adoc
@@ -0,0 +1,118 @@
+// Do not edit directly!
+// This file was generated by
camel-quarkus-maven-plugin:update-extension-doc-page
+[id="extensions-micrometer-observability"]
+= Micrometer Observability 2
+:linkattrs:
+:cq-artifact-id: camel-quarkus-micrometer-observability
+:cq-native-supported: true
+:cq-status: Stable
+:cq-status-deprecation: Stable
+:cq-description: Micrometer Observability implementation of Camel Telemetry
+:cq-deprecated: false
+:cq-jvm-since: 3.38.0
+:cq-native-since: 3.38.0
+
+ifeval::[{doc-show-badges} == true]
+[.badges]
+[.badge-key]##JVM since##[.badge-supported]##3.38.0## [.badge-key]##Native
since##[.badge-supported]##3.38.0##
+endif::[]
+
+Micrometer Observability implementation of Camel Telemetry
+
+[id="extensions-micrometer-observability-whats-inside"]
+== What's inside
+
+* xref:{cq-camel-components}:others:micrometer-observability.adoc[Micrometer
Observability 2]
+
+Please refer to the above link for usage and configuration details.
+
+[id="extensions-micrometer-observability-maven-coordinates"]
+== Maven coordinates
+
+https://{link-quarkus-code-generator}/?extension-search=camel-quarkus-micrometer-observability[Create
a new project with this extension on {link-quarkus-code-generator},
window="_blank"]
+
+Or add the coordinates to your existing project:
+
+[source,xml]
+----
+<dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-micrometer-observability</artifactId>
+</dependency>
+----
+ifeval::[{doc-show-user-guide-link} == true]
+Check the xref:user-guide/index.adoc[User guide] for more information about
writing Camel Quarkus applications.
+endif::[]
+
+[id="extensions-micrometer-observability-usage"]
+== Usage
+The extension automatically creates a `MicrometerObservabilityTracer` and
binds it to the Camel registry.
+It bridges Camel's telemetry SPI to Micrometer Tracing via the OTel bridge,
using the
+`OpenTelemetry` CDI bean provided by `quarkus-opentelemetry` (pulled in
transitively).
+
+Refer to the
xref:{cq-camel-components}:others:micrometer-observability.adoc[Micrometer
Observability 2] documentation for full details on tracing configuration.
+The following Quarkus config properties map directly to the tracer options
described there:
+
+[source,properties]
+----
+quarkus.camel.micrometer-observability.exclude-patterns=direct:*,timer:*
+quarkus.camel.micrometer-observability.include-patterns=platform-http:*
+quarkus.camel.micrometer-observability.trace-processors=true
+quarkus.camel.micrometer-observability.disable-core-processors=true
+quarkus.camel.micrometer-observability.trace-headers-inclusion=true
+----
+
+
+[id="extensions-micrometer-observability-additional-camel-quarkus-configuration"]
+== Additional Camel Quarkus configuration
+
+[width="100%",cols="80,5,15",options="header"]
+|===
+| Configuration property | Type | Default
+
+
+a|
[[quarkus-camel-micrometer-observability-exclude-patterns]]`link:#quarkus-camel-micrometer-observability-exclude-patterns[quarkus.camel.micrometer-observability.exclude-patterns]`
+
+Sets whether to disable tracing for endpoint URIs or Processor ids that match
the given comma separated patterns.
+The pattern can take the following forms:
+
+1. An exact match on the endpoint URI, e.g., {@code platform-http:/some/path}
+2. A wildcard match, e.g., {@code platform-http:*}
+3. A regular expression matching the endpoint URI, e.g., {@code
platform-http:/prefix/.*}
+| `string`
+|
+
+a|
[[quarkus-camel-micrometer-observability-include-patterns]]`link:#quarkus-camel-micrometer-observability-include-patterns[quarkus.camel.micrometer-observability.include-patterns]`
+
+Sets include pattern(s) that will explicitly enable tracing for Camel
processors that match the pattern.
+Multiple patterns can be separated by comma. All processors are included by
default if nothing is specified.
+| `string`
+|
+
+a|
[[quarkus-camel-micrometer-observability-trace-processors]]`link:#quarkus-camel-micrometer-observability-trace-processors[quarkus.camel.micrometer-observability.trace-processors]`
+
+Sets whether to create new spans for each Camel Processor. Use the {@code
excludePatterns} property to filter
+out specific processors.
+
+When enabled, this generates much more detailed traces but also increases
overhead.
+| `boolean`
+| `false`
+
+a|
[[quarkus-camel-micrometer-observability-disable-core-processors]]`link:#quarkus-camel-micrometer-observability-disable-core-processors[quarkus.camel.micrometer-observability.disable-core-processors]`
+
+Disable tracing of inner core processors (any core DSL processor provided in
the route, for example
+{@code bean}, {@code log}, ...).
+| `boolean`
+| `false`
+
+a|
[[quarkus-camel-micrometer-observability-trace-headers-inclusion]]`link:#quarkus-camel-micrometer-observability-trace-headers-inclusion[quarkus.camel.micrometer-observability.trace-headers-inclusion]`
+
+If set to {@code true}, adds the generated telemetry {@code CAMEL_TRACE_ID}
and {@code CAMEL_SPAN_ID}
+Exchange headers.
+| `boolean`
+| `false`
+|===
+
+[.configuration-legend]
+{doc-link-icon-lock}[title=Fixed at build time] Configuration property fixed
at build time. All other configuration properties are overridable at runtime.
+
diff --git a/extensions/micrometer-observability/deployment/pom.xml
b/extensions/micrometer-observability/deployment/pom.xml
new file mode 100644
index 0000000000..a6682522ff
--- /dev/null
+++ b/extensions/micrometer-observability/deployment/pom.xml
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-micrometer-observability-parent</artifactId>
+ <version>3.38.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-micrometer-observability-deployment</artifactId>
+ <name>Camel Quarkus :: Micrometer Observability 2 :: Deployment</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-core-deployment</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-micrometer-observability</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-opentelemetry-deployment</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-junit-internal</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <annotationProcessorPaths>
+ <path>
+ <groupId>io.quarkus</groupId>
+
<artifactId>quarkus-extension-processor</artifactId>
+ <version>${quarkus.version}</version>
+ </path>
+ </annotationProcessorPaths>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git
a/extensions/micrometer-observability/deployment/src/main/java/org/apache/camel/quarkus/component/micrometer/observability/deployment/MicrometerObservabilityProcessor.java
b/extensions/micrometer-observability/deployment/src/main/java/org/apache/camel/quarkus/component/micrometer/observability/deployment/MicrometerObservabilityProcessor.java
new file mode 100644
index 0000000000..f07a8673f3
--- /dev/null
+++
b/extensions/micrometer-observability/deployment/src/main/java/org/apache/camel/quarkus/component/micrometer/observability/deployment/MicrometerObservabilityProcessor.java
@@ -0,0 +1,48 @@
+/*
+ * 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.apache.camel.quarkus.component.micrometer.observability.deployment;
+
+import io.quarkus.arc.deployment.AdditionalBeanBuildItem;
+import io.quarkus.arc.deployment.UnremovableBeanBuildItem;
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+import
org.apache.camel.quarkus.component.micrometer.observability.MicrometerObservabilityTracerProducer;
+import org.apache.camel.telemetry.Tracer;
+
+class MicrometerObservabilityProcessor {
+
+ private static final String FEATURE = "camel-micrometer-observability";
+
+ @BuildStep
+ FeatureBuildItem feature() {
+ return new FeatureBuildItem(FEATURE);
+ }
+
+ @BuildStep
+ AdditionalBeanBuildItem tracerProducerBean() {
+ return AdditionalBeanBuildItem.builder()
+ .setUnremovable()
+ .addBeanClass(MicrometerObservabilityTracerProducer.class)
+ .build();
+ }
+
+ @BuildStep
+ UnremovableBeanBuildItem camelTracerUnremovableBean() {
+ return UnremovableBeanBuildItem.beanTypes(Tracer.class);
+ }
+
+}
diff --git a/extensions/micrometer-observability/pom.xml
b/extensions/micrometer-observability/pom.xml
new file mode 100644
index 0000000000..29d2487e0c
--- /dev/null
+++ b/extensions/micrometer-observability/pom.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-extensions</artifactId>
+ <version>3.38.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-micrometer-observability-parent</artifactId>
+ <name>Camel Quarkus :: Micrometer Observability 2</name>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>deployment</module>
+ <module>runtime</module>
+ </modules>
+</project>
diff --git a/extensions/micrometer-observability/runtime/pom.xml
b/extensions/micrometer-observability/runtime/pom.xml
new file mode 100644
index 0000000000..6c1238432d
--- /dev/null
+++ b/extensions/micrometer-observability/runtime/pom.xml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-micrometer-observability-parent</artifactId>
+ <version>3.38.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-micrometer-observability</artifactId>
+ <name>Camel Quarkus :: Micrometer Observability 2 :: Runtime</name>
+ <description>Micrometer Observability implementation of Camel
Telemetry</description>
+
+ <properties>
+ <camel.quarkus.jvmSince>3.38.0</camel.quarkus.jvmSince>
+ <camel.quarkus.nativeSince>3.38.0</camel.quarkus.nativeSince>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-micrometer-observability</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-opentelemetry</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.micrometer</groupId>
+ <artifactId>micrometer-tracing-bridge-otel</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-extension-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <annotationProcessorPaths>
+ <path>
+ <groupId>io.quarkus</groupId>
+
<artifactId>quarkus-extension-processor</artifactId>
+ <version>${quarkus.version}</version>
+ </path>
+ </annotationProcessorPaths>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+
+ <profiles>
+ <profile>
+ <id>full</id>
+ <activation>
+ <property>
+ <name>!quickly</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>update-extension-doc-page</id>
+ <goals>
+ <goal>update-extension-doc-page</goal>
+ </goals>
+ <phase>process-classes</phase>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
diff --git
a/extensions/micrometer-observability/runtime/src/main/doc/usage.adoc
b/extensions/micrometer-observability/runtime/src/main/doc/usage.adoc
new file mode 100644
index 0000000000..d25e97c476
--- /dev/null
+++ b/extensions/micrometer-observability/runtime/src/main/doc/usage.adoc
@@ -0,0 +1,15 @@
+The extension automatically creates a `MicrometerObservabilityTracer` and
binds it to the Camel registry.
+It bridges Camel's telemetry SPI to Micrometer Tracing via the OTel bridge,
using the
+`OpenTelemetry` CDI bean provided by `quarkus-opentelemetry` (pulled in
transitively).
+
+Refer to the
xref:{cq-camel-components}:others:micrometer-observability.adoc[Micrometer
Observability 2] documentation for full details on tracing configuration.
+The following Quarkus config properties map directly to the tracer options
described there:
+
+[source,properties]
+----
+quarkus.camel.micrometer-observability.exclude-patterns=direct:*,timer:*
+quarkus.camel.micrometer-observability.include-patterns=platform-http:*
+quarkus.camel.micrometer-observability.trace-processors=true
+quarkus.camel.micrometer-observability.disable-core-processors=true
+quarkus.camel.micrometer-observability.trace-headers-inclusion=true
+----
diff --git
a/extensions/micrometer-observability/runtime/src/main/java/org/apache/camel/quarkus/component/micrometer/observability/CamelMicrometerObservabilityConfig.java
b/extensions/micrometer-observability/runtime/src/main/java/org/apache/camel/quarkus/component/micrometer/observability/CamelMicrometerObservabilityConfig.java
new file mode 100644
index 0000000000..68fb554ab5
--- /dev/null
+++
b/extensions/micrometer-observability/runtime/src/main/java/org/apache/camel/quarkus/component/micrometer/observability/CamelMicrometerObservabilityConfig.java
@@ -0,0 +1,77 @@
+/*
+ * 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.apache.camel.quarkus.component.micrometer.observability;
+
+import java.util.Optional;
+
+import io.quarkus.runtime.annotations.ConfigPhase;
+import io.quarkus.runtime.annotations.ConfigRoot;
+import io.smallrye.config.ConfigMapping;
+import io.smallrye.config.WithDefault;
+
+@ConfigRoot(phase = ConfigPhase.RUN_TIME)
+@ConfigMapping(prefix = "quarkus.camel.micrometer-observability")
+public interface CamelMicrometerObservabilityConfig {
+ /**
+ * Sets whether to disable tracing for endpoint URIs or Processor ids that
match the given comma separated patterns.
+ * The pattern can take the following forms:
+ *
+ * 1. An exact match on the endpoint URI, e.g., {@code
platform-http:/some/path}
+ * 2. A wildcard match, e.g., {@code platform-http:*}
+ * 3. A regular expression matching the endpoint URI, e.g., {@code
platform-http:/prefix/.*}
+ *
+ * @asciidoclet
+ */
+ Optional<String> excludePatterns();
+
+ /**
+ * Sets include pattern(s) that will explicitly enable tracing for Camel
processors that match the pattern.
+ * Multiple patterns can be separated by comma. All processors are
included by default if nothing is specified.
+ *
+ * @asciidoclet
+ */
+ Optional<String> includePatterns();
+
+ /**
+ * Sets whether to create new spans for each Camel Processor. Use the
{@code excludePatterns} property to filter
+ * out specific processors.
+ *
+ * When enabled, this generates much more detailed traces but also
increases overhead.
+ *
+ * @asciidoclet
+ */
+ @WithDefault("false")
+ boolean traceProcessors();
+
+ /**
+ * Disable tracing of inner core processors (any core DSL processor
provided in the route, for example
+ * {@code bean}, {@code log}, ...).
+ *
+ * @asciidoclet
+ */
+ @WithDefault("false")
+ boolean disableCoreProcessors();
+
+ /**
+ * If set to {@code true}, adds the generated telemetry {@code
CAMEL_TRACE_ID} and {@code CAMEL_SPAN_ID}
+ * Exchange headers.
+ *
+ * @asciidoclet
+ */
+ @WithDefault("false")
+ boolean traceHeadersInclusion();
+}
diff --git
a/extensions/micrometer-observability/runtime/src/main/java/org/apache/camel/quarkus/component/micrometer/observability/MicrometerObservabilityTracerProducer.java
b/extensions/micrometer-observability/runtime/src/main/java/org/apache/camel/quarkus/component/micrometer/observability/MicrometerObservabilityTracerProducer.java
new file mode 100644
index 0000000000..20c635af10
--- /dev/null
+++
b/extensions/micrometer-observability/runtime/src/main/java/org/apache/camel/quarkus/component/micrometer/observability/MicrometerObservabilityTracerProducer.java
@@ -0,0 +1,81 @@
+/*
+ * 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.apache.camel.quarkus.component.micrometer.observability;
+
+import java.util.List;
+
+import io.micrometer.observation.ObservationRegistry;
+import io.micrometer.tracing.otel.bridge.OtelBaggageManager;
+import io.micrometer.tracing.otel.bridge.OtelCurrentTraceContext;
+import io.micrometer.tracing.otel.bridge.OtelPropagator;
+import io.micrometer.tracing.otel.bridge.OtelTracer;
+import io.opentelemetry.api.OpenTelemetry;
+import io.opentelemetry.api.trace.Tracer;
+import io.quarkus.arc.DefaultBean;
+import io.quarkus.opentelemetry.runtime.config.runtime.OTelRuntimeConfig;
+import jakarta.enterprise.inject.Produces;
+import jakarta.inject.Inject;
+import jakarta.inject.Singleton;
+import org.apache.camel.CamelContext;
+import org.apache.camel.micrometer.observability.MicrometerObservabilityTracer;
+
+@Singleton
+public class MicrometerObservabilityTracerProducer {
+
+ @Inject
+ CamelMicrometerObservabilityConfig config;
+
+ @Inject
+ OTelRuntimeConfig oTelRuntimeConfig;
+
+ @Inject
+ OpenTelemetry openTelemetry;
+
+ @Produces
+ @Singleton
+ @DefaultBean
+ public MicrometerObservabilityTracer
getMicrometerObservabilityTracer(CamelContext camelContext) {
+ if (oTelRuntimeConfig.sdkDisabled()) {
+ return null;
+ }
+
+ // Bridge from the Quarkus-provided OpenTelemetry bean to Micrometer
Tracing
+ Tracer nativeOtelTracer = openTelemetry.getTracer("camel");
+ OtelCurrentTraceContext currentTraceContext = new
OtelCurrentTraceContext();
+ OtelTracer otelTracer = new OtelTracer(
+ nativeOtelTracer,
+ currentTraceContext,
+ event -> {
+ },
+ new OtelBaggageManager(currentTraceContext, List.of(),
List.of()));
+ OtelPropagator otelPropagator = new
OtelPropagator(openTelemetry.getPropagators(), nativeOtelTracer);
+
+ MicrometerObservabilityTracer tracer = new
MicrometerObservabilityTracer();
+ tracer.setTracer(otelTracer);
+ tracer.setPropagator(otelPropagator);
+ tracer.setObservationRegistry(ObservationRegistry.create());
+
+ config.excludePatterns().ifPresent(tracer::setExcludePatterns);
+ config.includePatterns().ifPresent(tracer::setIncludePatterns);
+ tracer.setTraceProcessors(config.traceProcessors());
+ tracer.setDisableCoreProcessors(config.disableCoreProcessors());
+ tracer.setTraceHeadersInclusion(config.traceHeadersInclusion());
+
+ tracer.init(camelContext);
+ return tracer;
+ }
+}
diff --git
a/extensions/micrometer-observability/runtime/src/main/resources/META-INF/quarkus-extension.yaml
b/extensions/micrometer-observability/runtime/src/main/resources/META-INF/quarkus-extension.yaml
new file mode 100644
index 0000000000..5c352915fb
--- /dev/null
+++
b/extensions/micrometer-observability/runtime/src/main/resources/META-INF/quarkus-extension.yaml
@@ -0,0 +1,38 @@
+#
+# 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.
+#
+
+# This is a generated file. Do not edit directly!
+# To re-generate, run the following command from the top level directory:
+#
+# mvn -N cq:update-quarkus-metadata
+#
+---
+name: "Camel Micrometer Observability 2"
+description: "Micrometer Observability implementation of Camel Telemetry"
+metadata:
+ icon-url:
"https://raw.githubusercontent.com/apache/camel-website/main/antora-ui-camel/src/img/logo-d.svg"
+ sponsor: "Apache Software Foundation"
+ guide:
"https://camel.apache.org/camel-quarkus/latest/reference/extensions/micrometer-observability.html"
+ categories:
+ - "integration"
+ config:
+ - "quarkus.camel.micrometer-observability"
+ status: "stable"
+ integrates:
+ - name: "Camel"
+ artifact: "org.apache.camel:camel-base"
+ version: "${camel.version}"
\ No newline at end of file
diff --git a/extensions/pom.xml b/extensions/pom.xml
index 26e5d187d9..5cf89a5a7e 100644
--- a/extensions/pom.xml
+++ b/extensions/pom.xml
@@ -205,6 +205,7 @@
<module>master</module>
<module>mdc</module>
<module>micrometer</module>
+ <module>micrometer-observability</module>
<module>microprofile-fault-tolerance</module>
<module>microprofile-health</module>
<module>milo</module>
diff --git a/integration-tests/micrometer-observability/pom.xml
b/integration-tests/micrometer-observability/pom.xml
new file mode 100644
index 0000000000..7be0d012c7
--- /dev/null
+++ b/integration-tests/micrometer-observability/pom.xml
@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-build-parent-it</artifactId>
+ <version>3.38.0-SNAPSHOT</version>
+ <relativePath>../../poms/build-parent-it/pom.xml</relativePath>
+ </parent>
+
+
<artifactId>camel-quarkus-integration-test-micrometer-observability</artifactId>
+ <name>Camel Quarkus :: Integration Tests :: Micrometer Observability
2</name>
+ <description>Integration tests for Camel Quarkus Micrometer Observability
2 extension</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-micrometer-observability</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-direct</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-rest</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-rest-jackson</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.opentelemetry</groupId>
+ <artifactId>opentelemetry-sdk-testing</artifactId>
+ </dependency>
+
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.rest-assured</groupId>
+ <artifactId>rest-assured</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.awaitility</groupId>
+ <artifactId>awaitility</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>native</id>
+ <activation>
+ <property>
+ <name>native</name>
+ </property>
+ </activation>
+ <properties>
+ <quarkus.native.enabled>true</quarkus.native.enabled>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>virtualDependencies</id>
+ <activation>
+ <property>
+ <name>!noVirtualDependencies</name>
+ </property>
+ </activation>
+ <dependencies>
+ <!-- The following dependencies guarantee that this module is
built after them. You can update them by running `mvn process-resources
-Pformat -N` from the source tree root directory -->
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-direct-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+
<artifactId>camel-quarkus-micrometer-observability-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
+</project>
diff --git
a/integration-tests/micrometer-observability/src/main/java/org/apache/camel/quarkus/component/micrometer/observability/it/MicrometerObservabilityResource.java
b/integration-tests/micrometer-observability/src/main/java/org/apache/camel/quarkus/component/micrometer/observability/it/MicrometerObservabilityResource.java
new file mode 100644
index 0000000000..92df917fae
--- /dev/null
+++
b/integration-tests/micrometer-observability/src/main/java/org/apache/camel/quarkus/component/micrometer/observability/it/MicrometerObservabilityResource.java
@@ -0,0 +1,64 @@
+/*
+ * 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.apache.camel.quarkus.component.micrometer.observability.it;
+
+import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.inject.Inject;
+import jakarta.ws.rs.GET;
+import jakarta.ws.rs.HeaderParam;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.core.MediaType;
+import org.apache.camel.ProducerTemplate;
+
+@Path("/micrometer-observability")
+@ApplicationScoped
+public class MicrometerObservabilityResource {
+
+ @Inject
+ ProducerTemplate producerTemplate;
+
+ @Path("/trace")
+ @GET
+ @Produces(MediaType.TEXT_PLAIN)
+ public String trace() {
+ return producerTemplate.requestBody("direct:traced", "test",
String.class);
+ }
+
+ /**
+ * Accepts an optional {@code traceparent} W3C header and forwards it into
the Camel exchange.
+ * The Propagator will extract the upstream trace context from this header
and attach
+ * all Camel spans to the same trace, which is the core
distributed-tracing scenario.
+ */
+ @Path("/trace-excluded")
+ @GET
+ @Produces(MediaType.TEXT_PLAIN)
+ public String traceExcluded() {
+ return producerTemplate.requestBody("direct:excluded", "test",
String.class);
+ }
+
+ @Path("/trace-upstream")
+ @GET
+ @Produces(MediaType.TEXT_PLAIN)
+ public String traceUpstream(@HeaderParam("traceparent") String
traceparent) {
+ if (traceparent != null) {
+ return producerTemplate.requestBodyAndHeader("direct:traced",
"test",
+ "traceparent", traceparent, String.class);
+ }
+ return producerTemplate.requestBody("direct:traced", "test",
String.class);
+ }
+}
diff --git
a/integration-tests/micrometer-observability/src/main/java/org/apache/camel/quarkus/component/micrometer/observability/it/MicrometerObservabilityRoutes.java
b/integration-tests/micrometer-observability/src/main/java/org/apache/camel/quarkus/component/micrometer/observability/it/MicrometerObservabilityRoutes.java
new file mode 100644
index 0000000000..bdcbbc0e52
--- /dev/null
+++
b/integration-tests/micrometer-observability/src/main/java/org/apache/camel/quarkus/component/micrometer/observability/it/MicrometerObservabilityRoutes.java
@@ -0,0 +1,36 @@
+/*
+ * 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.apache.camel.quarkus.component.micrometer.observability.it;
+
+import jakarta.enterprise.context.ApplicationScoped;
+import org.apache.camel.builder.RouteBuilder;
+
+@ApplicationScoped
+public class MicrometerObservabilityRoutes extends RouteBuilder {
+
+ @Override
+ public void configure() throws Exception {
+ from("direct:traced")
+ .routeId("traced-route")
+ .setBody(constant("traced-response"));
+
+ // This route is excluded from tracing via
quarkus.camel.micrometer-observability.exclude-patterns
+ from("direct:excluded")
+ .routeId("excluded-route")
+ .setBody(constant("excluded-response"));
+ }
+}
diff --git
a/integration-tests/micrometer-observability/src/main/java/org/apache/camel/quarkus/component/micrometer/observability/it/SpanExporterProducer.java
b/integration-tests/micrometer-observability/src/main/java/org/apache/camel/quarkus/component/micrometer/observability/it/SpanExporterProducer.java
new file mode 100644
index 0000000000..3c53a76faf
--- /dev/null
+++
b/integration-tests/micrometer-observability/src/main/java/org/apache/camel/quarkus/component/micrometer/observability/it/SpanExporterProducer.java
@@ -0,0 +1,32 @@
+/*
+ * 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.apache.camel.quarkus.component.micrometer.observability.it;
+
+import io.opentelemetry.sdk.testing.exporter.InMemorySpanExporter;
+import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.enterprise.inject.Produces;
+import jakarta.inject.Singleton;
+
+@ApplicationScoped
+public class SpanExporterProducer {
+
+ @Produces
+ @Singleton
+ public InMemorySpanExporter createInMemoryExporter() {
+ return InMemorySpanExporter.create();
+ }
+}
diff --git
a/integration-tests/micrometer-observability/src/main/java/org/apache/camel/quarkus/component/micrometer/observability/it/SpanExporterResource.java
b/integration-tests/micrometer-observability/src/main/java/org/apache/camel/quarkus/component/micrometer/observability/it/SpanExporterResource.java
new file mode 100644
index 0000000000..1564963455
--- /dev/null
+++
b/integration-tests/micrometer-observability/src/main/java/org/apache/camel/quarkus/component/micrometer/observability/it/SpanExporterResource.java
@@ -0,0 +1,97 @@
+/*
+ * 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.apache.camel.quarkus.component.micrometer.observability.it;
+
+import java.util.Map;
+
+import io.opentelemetry.api.common.AttributeKey;
+import io.opentelemetry.sdk.testing.exporter.InMemorySpanExporter;
+import jakarta.inject.Inject;
+import jakarta.json.Json;
+import jakarta.json.JsonArray;
+import jakarta.json.JsonArrayBuilder;
+import jakarta.json.JsonObject;
+import jakarta.json.JsonObjectBuilder;
+import jakarta.ws.rs.GET;
+import jakarta.ws.rs.POST;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.Response;
+import org.apache.camel.CamelContext;
+import org.apache.camel.micrometer.observability.MicrometerObservabilityTracer;
+
+@Path("/micrometer-observability/exporter")
+public class SpanExporterResource {
+
+ @Inject
+ InMemorySpanExporter exporter;
+
+ @Inject
+ CamelContext camelContext;
+
+ @Path("/spans")
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ public JsonArray getSpans() {
+ JsonArrayBuilder arrayBuilder = Json.createArrayBuilder();
+ exporter.getFinishedSpanItems().stream()
+ .filter(span ->
!span.getName().contains("/micrometer-observability/"))
+ .forEach(span -> {
+ Map<AttributeKey<?>, Object> attributes =
span.getAttributes().asMap();
+ JsonObjectBuilder objectBuilder =
Json.createObjectBuilder();
+ objectBuilder.add("spanId", span.getSpanId());
+ objectBuilder.add("traceId", span.getTraceId());
+ objectBuilder.add("parentSpanId", span.getParentSpanId());
+ objectBuilder.add("name", span.getName());
+ attributes.forEach((k, v) ->
objectBuilder.add(String.valueOf(k), v.toString()));
+ arrayBuilder.add(objectBuilder.build());
+ });
+ return arrayBuilder.build();
+ }
+
+ @Path("/spans/reset")
+ @POST
+ public Response resetSpans() {
+ exporter.reset();
+ return Response.noContent().build();
+ }
+
+ /**
+ * Returns the live configuration values of the {@link
MicrometerObservabilityTracer} registered
+ * in the Camel registry. Used by {@code testConfigPropertiesAreWired} to
verify that all five
+ * {@code quarkus.camel.micrometer-observability.*} properties are
correctly passed through
+ * {@code CamelMicrometerObservabilityConfig} → {@code
MicrometerObservabilityTracerProducer}
+ * → the tracer instance.
+ */
+ @Path("/tracer-config")
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ public JsonObject getTracerConfig() {
+ MicrometerObservabilityTracer tracer = camelContext.getRegistry()
+ .findSingleByType(MicrometerObservabilityTracer.class);
+ JsonObjectBuilder builder = Json.createObjectBuilder();
+ if (tracer != null) {
+ builder.add("excludePatterns", tracer.getExcludePatterns() != null
? tracer.getExcludePatterns() : "");
+ builder.add("includePatterns", tracer.getIncludePatterns() != null
? tracer.getIncludePatterns() : "");
+ builder.add("traceProcessors", tracer.isTraceProcessors());
+ builder.add("disableCoreProcessors",
tracer.isDisableCoreProcessors());
+ builder.add("traceHeadersInclusion",
tracer.isTraceHeadersInclusion());
+ }
+ return builder.build();
+ }
+}
diff --git
a/integration-tests/micrometer-observability/src/main/resources/application.properties
b/integration-tests/micrometer-observability/src/main/resources/application.properties
new file mode 100644
index 0000000000..12707f8b0e
--- /dev/null
+++
b/integration-tests/micrometer-observability/src/main/resources/application.properties
@@ -0,0 +1,26 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+# Quarkus configuration
+quarkus.banner.enabled = false
+
+# Configuration properties wired by MicrometerObservabilityTracerProducer —
verified by testConfigPropertiesAreWired
+quarkus.camel.micrometer-observability.exclude-patterns = direct:excluded
+quarkus.camel.micrometer-observability.include-patterns = direct:traced
+quarkus.camel.micrometer-observability.trace-processors = true
+quarkus.camel.micrometer-observability.disable-core-processors = true
+quarkus.camel.micrometer-observability.trace-headers-inclusion = true
diff --git
a/integration-tests/micrometer-observability/src/test/java/org/apache/camel/quarkus/component/micrometer/observability/it/MicrometerObservabilityIT.java
b/integration-tests/micrometer-observability/src/test/java/org/apache/camel/quarkus/component/micrometer/observability/it/MicrometerObservabilityIT.java
new file mode 100644
index 0000000000..79fea37473
--- /dev/null
+++
b/integration-tests/micrometer-observability/src/test/java/org/apache/camel/quarkus/component/micrometer/observability/it/MicrometerObservabilityIT.java
@@ -0,0 +1,24 @@
+/*
+ * 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.apache.camel.quarkus.component.micrometer.observability.it;
+
+import io.quarkus.test.junit.QuarkusIntegrationTest;
+
+@QuarkusIntegrationTest
+class MicrometerObservabilityIT extends MicrometerObservabilityTest {
+
+}
diff --git
a/integration-tests/micrometer-observability/src/test/java/org/apache/camel/quarkus/component/micrometer/observability/it/MicrometerObservabilityTest.java
b/integration-tests/micrometer-observability/src/test/java/org/apache/camel/quarkus/component/micrometer/observability/it/MicrometerObservabilityTest.java
new file mode 100644
index 0000000000..fa390bce8b
--- /dev/null
+++
b/integration-tests/micrometer-observability/src/test/java/org/apache/camel/quarkus/component/micrometer/observability/it/MicrometerObservabilityTest.java
@@ -0,0 +1,157 @@
+/*
+ * 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.apache.camel.quarkus.component.micrometer.observability.it;
+
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+import io.quarkus.test.junit.QuarkusTest;
+import io.restassured.RestAssured;
+import io.restassured.path.json.JsonPath;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Test;
+
+import static org.awaitility.Awaitility.await;
+import static org.hamcrest.Matchers.equalTo;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+@QuarkusTest
+class MicrometerObservabilityTest {
+
+ @AfterEach
+ public void afterEach() {
+ RestAssured.post("/micrometer-observability/exporter/spans/reset")
+ .then()
+ .statusCode(204);
+ }
+
+ /**
+ * Verifies that the Quarkus extension correctly wires the
MicrometerObservabilityTracer
+ * with the Quarkus-provided OpenTelemetry bean (via OtelTracer bridge)
and that Camel routes
+ * produce spans that reach the OTel SDK pipeline (InMemorySpanExporter).
+ *
+ * This validates the full chain: Camel → MicrometerObservabilityTracer →
OtelTracer bridge → OTel SDK.
+ */
+ @Test
+ void testSpansAreGenerated() {
+ RestAssured.get("/micrometer-observability/trace")
+ .then()
+ .statusCode(200)
+ .body(equalTo("traced-response"));
+
+ await().atMost(10, TimeUnit.SECONDS).untilAsserted(() -> {
+ JsonPath spans =
RestAssured.get("/micrometer-observability/exporter/spans")
+ .then().statusCode(200).extract().jsonPath();
+
+ List<Object> spanList = spans.getList("$");
+ assertFalse(spanList.isEmpty(),
+ "Expected at least one span from direct:traced route —
OtelTracer bridge wiring may be broken");
+ });
+ }
+
+ /**
+ * Verifies that quarkus.camel.micrometer-observability.exclude-patterns
is correctly applied.
+ * The route direct:excluded is listed in exclude-patterns so it must
produce no spans.
+ * The route direct:traced (not excluded) must produce at least one span.
+ */
+ @Test
+ void testExcludePatternsAreApplied() {
+ RestAssured.get("/micrometer-observability/trace-excluded")
+ .then()
+ .statusCode(200)
+ .body(equalTo("excluded-response"));
+
+ await().atMost(5, TimeUnit.SECONDS).untilAsserted(() -> {
+ JsonPath spans =
RestAssured.get("/micrometer-observability/exporter/spans")
+ .then().statusCode(200).extract().jsonPath();
+ List<Object> spanList = spans.getList("$");
+ assertTrue(spanList.isEmpty(),
+ "direct:excluded is in exclude-patterns — no spans
expected, got: " + spanList);
+ });
+
+
RestAssured.post("/micrometer-observability/exporter/spans/reset").then().statusCode(204);
+
RestAssured.get("/micrometer-observability/trace").then().statusCode(200);
+
+ await().atMost(10, TimeUnit.SECONDS).untilAsserted(() -> {
+ JsonPath spans =
RestAssured.get("/micrometer-observability/exporter/spans")
+ .then().statusCode(200).extract().jsonPath();
+ List<Object> spanList = spans.getList("$");
+ assertFalse(spanList.isEmpty(),
+ "direct:traced is not excluded — expected spans, got
none");
+ });
+ }
+
+ /**
+ * Verifies that the CDI bean {@code CamelMicrometerObservabilityConfig}
correctly picks up
+ * all five {@code quarkus.camel.micrometer-observability.*} properties
from
+ * {@code application.properties} and that {@code
MicrometerObservabilityTracerProducer}
+ * passes them through to the live {@code MicrometerObservabilityTracer}.
+ *
+ * This is purely a Quarkus extension concern: camel upstream is
responsible for what these
+ * options do at runtime; we only verify the configuration wiring is not
broken.
+ */
+ @Test
+ void testConfigPropertiesAreWired() {
+ JsonPath config =
RestAssured.get("/micrometer-observability/exporter/tracer-config")
+ .then().statusCode(200).extract().jsonPath();
+
+ assertEquals("direct:excluded", config.getString("excludePatterns"),
+ "exclude-patterns must be wired to the tracer");
+ assertEquals("direct:traced", config.getString("includePatterns"),
+ "include-patterns must be wired to the tracer");
+ assertTrue(config.getBoolean("traceProcessors"),
+ "trace-processors=true must be wired to the tracer");
+ assertTrue(config.getBoolean("disableCoreProcessors"),
+ "disable-core-processors=true must be wired to the tracer");
+ assertTrue(config.getBoolean("traceHeadersInclusion"),
+ "trace-headers-inclusion=true must be wired to the tracer");
+ }
+
+ /**
+ * Verifies that W3C traceparent propagation works end-to-end.
+ * A request carrying a {@code traceparent} header must cause all Camel
spans to be
+ * attached to the external trace (same traceId).
+ */
+ @Test
+ void testUpstreamW3CTracePropagation() {
+ String externalTraceId = "0af044aea5c127fd5ab5f839de2b8ae2";
+ String externalSpanId = "d362a8a943c2b289";
+ String traceparent = "00-" + externalTraceId + "-" + externalSpanId +
"-01";
+
+ RestAssured.given()
+ .header("traceparent", traceparent)
+ .get("/micrometer-observability/trace-upstream")
+ .then()
+ .statusCode(200);
+
+ await().atMost(10, TimeUnit.SECONDS).untilAsserted(() -> {
+ JsonPath spans =
RestAssured.get("/micrometer-observability/exporter/spans")
+ .then().statusCode(200).extract().jsonPath();
+
+ List<String> traceIds = spans.getList("traceId");
+ assertFalse(traceIds.isEmpty(), "Expected at least one span from
the upstream-propagation request");
+
+ // All Camel spans must share the external traceId
+ for (String traceId : traceIds) {
+ assertEquals(externalTraceId, traceId,
+ "Camel span traceId must match the upstream
traceparent traceId");
+ }
+ });
+ }
+}
diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml
index 1bd3422916..b6af38477b 100644
--- a/integration-tests/pom.xml
+++ b/integration-tests/pom.xml
@@ -180,6 +180,7 @@
<module>master-openshift</module>
<module>mdc</module>
<module>micrometer</module>
+ <module>micrometer-observability</module>
<module>microprofile-fault-tolerance</module>
<module>microprofile-health</module>
<module>milo</module>
diff --git a/pom.xml b/pom.xml
index b7994ee67f..42cb9c2092 100644
--- a/pom.xml
+++ b/pom.xml
@@ -146,6 +146,7 @@
<langchain4j-beta.version>1.17.2-beta27</langchain4j-beta.version><!--
@sync dev.langchain4j:langchain4j-bom:${langchain4j.version}
prop:langchain4j.beta.version -->
<mapstruct.version>${mapstruct-version}</mapstruct.version>
<mbassador.version>1.3.0</mbassador.version><!-- @sync
com.hierynomus:smbj:${smbj-version} dep:net.engio:mbassador -->
+ <micrometer-tracing.version>1.6.6</micrometer-tracing.version><!-- Not
in quarkus-bom yet, align with micrometer version in
io.quarkus:quarkus-bom:${quarkus.version} - tracing 1.6.x matches core 1.16.x
https://repo1.maven.org/maven2/io/micrometer/micrometer-tracing-bom/ -->
<minio.version>8.6.0</minio.version><!-- @sync
io.quarkiverse.minio:quarkus-minio-parent:${quarkiverse-minio.version}
prop:minio.version -->
<msal4j.version>1.23.1</msal4j.version><!-- @sync
com.azure:azure-identity:${azure-identity.version}
dep:com.microsoft.azure:msal4j -->
<murmur.version>1.0.0</murmur.version>
diff --git a/poms/bom/pom.xml b/poms/bom/pom.xml
index e887ffde64..bb239f44b7 100644
--- a/poms/bom/pom.xml
+++ b/poms/bom/pom.xml
@@ -2311,6 +2311,11 @@
<artifactId>camel-micrometer</artifactId>
<version>${camel.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-micrometer-observability</artifactId>
+ <version>${camel.version}</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-microprofile-config</artifactId>
@@ -5646,6 +5651,16 @@
<artifactId>camel-quarkus-micrometer-deployment</artifactId>
<version>${camel-quarkus.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-micrometer-observability</artifactId>
+ <version>${camel-quarkus.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+
<artifactId>camel-quarkus-micrometer-observability-deployment</artifactId>
+ <version>${camel-quarkus.version}</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-microprofile-fault-tolerance</artifactId>
@@ -7790,6 +7805,16 @@
<artifactId>metrics-jmx</artifactId>
<version>${dropwizard-metrics.version}</version>
</dependency>
+ <dependency>
+ <groupId>io.micrometer</groupId>
+ <artifactId>micrometer-tracing</artifactId>
+ <version>${micrometer-tracing.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.micrometer</groupId>
+ <artifactId>micrometer-tracing-bridge-otel</artifactId>
+ <version>${micrometer-tracing.version}</version>
+ </dependency>
<dependency>
<groupId>io.minio</groupId>
<artifactId>minio</artifactId>
diff --git a/poms/bom/src/main/generated/flattened-full-pom.xml
b/poms/bom/src/main/generated/flattened-full-pom.xml
index f5acff9887..7452cd5335 100644
--- a/poms/bom/src/main/generated/flattened-full-pom.xml
+++ b/poms/bom/src/main/generated/flattened-full-pom.xml
@@ -2224,6 +2224,11 @@
<artifactId>camel-micrometer</artifactId>
<version>4.21.0</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-micrometer-observability</artifactId>
+ <version>4.21.0</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-microprofile-config</artifactId>
@@ -5531,6 +5536,16 @@
<artifactId>camel-quarkus-micrometer-deployment</artifactId>
<version>3.38.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-micrometer-observability</artifactId>
+ <version>3.38.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+
<artifactId>camel-quarkus-micrometer-observability-deployment</artifactId>
+ <version>3.38.0-SNAPSHOT</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-microprofile-fault-tolerance</artifactId>
@@ -7672,6 +7687,16 @@
<artifactId>metrics-jmx</artifactId>
<version>4.2.39</version>
</dependency>
+ <dependency>
+ <groupId>io.micrometer</groupId>
+ <artifactId>micrometer-tracing</artifactId>
+ <version>1.6.6</version>
+ </dependency>
+ <dependency>
+ <groupId>io.micrometer</groupId>
+ <artifactId>micrometer-tracing-bridge-otel</artifactId>
+ <version>1.6.6</version>
+ </dependency>
<dependency>
<groupId>io.minio</groupId>
<artifactId>minio</artifactId>
diff --git a/poms/bom/src/main/generated/flattened-reduced-pom.xml
b/poms/bom/src/main/generated/flattened-reduced-pom.xml
index bb02426b83..e2ff7befd7 100644
--- a/poms/bom/src/main/generated/flattened-reduced-pom.xml
+++ b/poms/bom/src/main/generated/flattened-reduced-pom.xml
@@ -914,6 +914,16 @@
<artifactId>metrics-servlets</artifactId>
<version>4.0.1</version>
</dependency>
+ <dependency>
+ <groupId>io.micrometer</groupId>
+ <artifactId>micrometer-tracing</artifactId>
+ <version>1.6.6</version>
+ </dependency>
+ <dependency>
+ <groupId>io.micrometer</groupId>
+ <artifactId>micrometer-tracing-bridge-otel</artifactId>
+ <version>1.6.6</version>
+ </dependency>
<dependency>
<groupId>io.minio</groupId>
<artifactId>minio</artifactId>
@@ -3552,6 +3562,11 @@
<artifactId>camel-micrometer</artifactId>
<version>4.21.0</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-micrometer-observability</artifactId>
+ <version>4.21.0</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-microprofile-config</artifactId>
@@ -6864,6 +6879,16 @@
<artifactId>camel-quarkus-micrometer-deployment</artifactId>
<version>3.38.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-micrometer-observability</artifactId>
+ <version>3.38.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+
<artifactId>camel-quarkus-micrometer-observability-deployment</artifactId>
+ <version>3.38.0-SNAPSHOT</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-microprofile-fault-tolerance</artifactId>
diff --git a/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml
b/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml
index 828b843510..4fda385aa9 100644
--- a/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml
+++ b/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml
@@ -914,6 +914,16 @@
<artifactId>metrics-servlets</artifactId>
<version>4.0.1</version>
</dependency>
+ <dependency>
+ <groupId>io.micrometer</groupId>
+ <artifactId>micrometer-tracing</artifactId>
+ <version>1.6.6</version>
+ </dependency>
+ <dependency>
+ <groupId>io.micrometer</groupId>
+ <artifactId>micrometer-tracing-bridge-otel</artifactId>
+ <version>1.6.6</version>
+ </dependency>
<dependency>
<groupId>io.minio</groupId>
<artifactId>minio</artifactId>
@@ -3552,6 +3562,11 @@
<artifactId>camel-micrometer</artifactId>
<version>4.21.0</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-micrometer-observability</artifactId>
+ <version>4.21.0</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-microprofile-config</artifactId>
@@ -6864,6 +6879,16 @@
<artifactId>camel-quarkus-micrometer-deployment</artifactId>
<version>3.38.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-micrometer-observability</artifactId>
+ <version>3.38.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+
<artifactId>camel-quarkus-micrometer-observability-deployment</artifactId>
+ <version>3.38.0-SNAPSHOT</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-microprofile-fault-tolerance</artifactId>
diff --git a/tooling/scripts/test-categories.yaml
b/tooling/scripts/test-categories.yaml
index ee0a7b6be3..6eecf4224a 100644
--- a/tooling/scripts/test-categories.yaml
+++ b/tooling/scripts/test-categories.yaml
@@ -92,6 +92,7 @@ group-04:
- leveldb
- mdc
- micrometer
+ - micrometer-observability
- minio
- mongodb-grouped
- mybatis