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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions catalog/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2840,6 +2840,19 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-micrometer-observability</artifactId>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

there is only one micrometer-observability component in camel upstream, I think i need to follow the same and no need to add '2'?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If I read correctly, there are:

So I guess we should use camel-quarkus-micrometer-observability as the name of the artifact id but maybe mention the number 2 in the doc page

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

<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>
Expand Down
13 changes: 13 additions & 0 deletions docs/modules/ROOT/examples/others/micrometer-observability.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
@@ -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.

72 changes: 72 additions & 0 deletions extensions/micrometer-observability/deployment/pom.xml
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
@@ -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);
}

}
39 changes: 39 additions & 0 deletions extensions/micrometer-observability/pom.xml
Original file line number Diff line number Diff line change
@@ -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>
Loading