JiriOndrusek commented on code in PR #8879:
URL: https://github.com/apache/camel-quarkus/pull/8879#discussion_r3586009896
##########
catalog/pom.xml:
##########
@@ -2840,6 +2840,19 @@
</exclusion>
</exclusions>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-micrometer-observability</artifactId>
Review Comment:
idea: Because there are 2 micrometer-observabilty components in Camel
(https://camel.apache.org/components/4.18.x/others/micrometer-observability.html
and
https://camel.apache.org/components/4.18.x/others/micrometer-observability.html),
should we use the number '2' in the name of CQ extension to reflect which one
of the components we are extending?
##########
docs/modules/ROOT/pages/reference/extensions/micrometer-observability.adoc:
##########
@@ -0,0 +1,177 @@
+// 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, which in turn
delegates to any
+https://micrometer.io/docs/tracing[Micrometer Tracing] backend (Brave,
OpenTelemetry, …).
+
+[id="extensions-micrometer-observability-usage-prerequisites"]
+=== Prerequisites
+
+Provide a Micrometer `Tracer`, `ObservationRegistry` and `Propagator` as CDI
beans; the
+extension picks them up automatically.
+Without them the extension falls back to NOOP implementations (a warning is
logged) — useful for
+local development but no traces are exported.
+
+For OpenTelemetry, add the Micrometer–OTel bridge:
+
+[source,xml]
+----
+<dependency>
+ <groupId>io.micrometer</groupId>
+ <artifactId>micrometer-tracing-bridge-otel</artifactId>
+</dependency>
+----
+
+Then set an exporter endpoint (see the
https://quarkus.io/guides/opentelemetry[Quarkus OpenTelemetry guide]):
+
+[source,properties]
+----
+quarkus.otel.exporter.otlp.traces.endpoint=http://localhost:4317
+----
+
+For Brave/Zipkin, add `micrometer-tracing-bridge-brave` instead and configure
the reporter of your choice.
+
+[id="extensions-micrometer-observability-usage-filtering-endpoints"]
+=== Filtering endpoints
+
+`exclude-patterns` suppresses tracing for matching endpoints;
`include-patterns` traces only
+matching endpoints (others are silently skipped).
+Values are comma-separated exact URIs, wildcards (`direct:*`), or regular
expressions:
+
+[source,properties]
+----
+quarkus.camel.micrometer-observability.exclude-patterns=direct:*,timer:*
+quarkus.camel.micrometer-observability.include-patterns=platform-http:*
+----
+
+[id="extensions-micrometer-observability-usage-tracing-camel-processors"]
+=== Tracing Camel Processors
+
+By default only route-level spans are created.
+`trace-processors=true` adds a span per individual processor (higher overhead).
+`disable-core-processors=true` limits those extra spans to custom `Processor`
implementations
+only, skipping built-in DSL steps such as `bean`, `log`, and `setBody`.
+
+[source,properties]
+----
+quarkus.camel.micrometer-observability.trace-processors=true
+quarkus.camel.micrometer-observability.disable-core-processors=true
+----
+
+[id="extensions-micrometer-observability-usage-trace-id-span-id-exchange-headers"]
+=== Trace ID / Span ID Exchange headers
+
+Set `trace-headers-inclusion=true` to propagate `CAMEL_TRACE_ID` and
`CAMEL_SPAN_ID` as Camel
+Exchange headers, which makes them available for MDC logging or custom
downstream logic.
+
+
+[id="extensions-micrometer-observability-additional-camel-quarkus-configuration"]
+== Additional Camel Quarkus configuration
+
+This extension is fully supported in native mode.
+
+The extension registers `io.micrometer.tracing.test.simple.SimpleTraceContext`
for runtime
Review Comment:
nitpick: I think that it is not necessary to list all configuration here.
Having the extension placed in `extensions` and not `extensions-jvm` makes
clear that native is suppoorted. Also when anybody adds something to
configuration, the doc will be out-of-date
##########
extensions/micrometer-observability/runtime/src/main/doc/usage.adoc:
##########
@@ -0,0 +1,59 @@
+The extension automatically creates a `MicrometerObservabilityTracer` and
binds it to the Camel registry.
+It bridges Camel's telemetry SPI to Micrometer Tracing, which in turn
delegates to any
+https://micrometer.io/docs/tracing[Micrometer Tracing] backend (Brave,
OpenTelemetry, …).
+
+=== Prerequisites
+
+Provide a Micrometer `Tracer`, `ObservationRegistry` and `Propagator` as CDI
beans; the
+extension picks them up automatically.
+Without them the extension falls back to NOOP implementations (a warning is
logged) — useful for
+local development but no traces are exported.
+
+For OpenTelemetry, add the Micrometer–OTel bridge:
+
+[source,xml]
+----
+<dependency>
+ <groupId>io.micrometer</groupId>
+ <artifactId>micrometer-tracing-bridge-otel</artifactId>
+</dependency>
+----
+
+Then set an exporter endpoint (see the
https://quarkus.io/guides/opentelemetry[Quarkus OpenTelemetry guide]):
+
+[source,properties]
+----
+quarkus.otel.exporter.otlp.traces.endpoint=http://localhost:4317
+----
+
+For Brave/Zipkin, add `micrometer-tracing-bridge-brave` instead and configure
the reporter of your choice.
+
+=== Filtering endpoints
Review Comment:
Probably don't needed to be mentioned, as it is part of the camel doc. (this
comment can be applied on more parts of this page)
##########
extensions/micrometer-observability/runtime/src/main/doc/configuration.adoc:
##########
@@ -0,0 +1,9 @@
+This extension is fully supported in native mode.
Review Comment:
Same as before, we probably don't need to document this.
##########
extensions/micrometer-observability/deployment/src/main/java/org/apache/camel/quarkus/component/micrometer/observability/deployment/MicrometerObservabilityProcessor.java:
##########
@@ -0,0 +1,53 @@
+/*
+ * 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
io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem;
+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);
+ }
+
+ @BuildStep
+ RuntimeInitializedClassBuildItem runtimeInitializedClasses() {
+ return new
RuntimeInitializedClassBuildItem("io.micrometer.tracing.test.simple.SimpleTraceContext");
Review Comment:
This class is from micrometer-tracing-test, there it is not needed to
register it, if the test dependency is not present. Something like
```
if
(index.getIndex().getClassByName("io.micrometer.tracing.test.simple.SimpleTraceContext")
!=
null) {
runtimeInit.produce(new RuntimeInitializedClassBuildItem(
"io.micrometer.tracing.test.simple.SimpleTraceContext"));
}
```
would be better (or different way of condition..
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]