-
Notifications
You must be signed in to change notification settings - Fork 228
Add camel-quarkus-micrometer-observability extension with native support #8879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
JinyuChen97
wants to merge
1
commit into
apache:main
Choose a base branch
from
JinyuChen97:support-camel-micrometer-observability
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,313
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
docs/modules/ROOT/examples/others/micrometer-observability.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
118 changes: 118 additions & 0 deletions
118
docs/modules/ROOT/pages/reference/extensions/micrometer-observability.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
48 changes: 48 additions & 0 deletions
48
...arkus/component/micrometer/observability/deployment/MicrometerObservabilityProcessor.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | ||
| } | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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'?
There was a problem hiding this comment.
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:
Micrometer Observabilityprovided bycamel-observationmaven module with doc page https://camel.apache.org/components/4.18.x/others/observation.htmlMicrometer Observability 2provided bycamel-micrometer-observabilitymaven module with doc page https://camel.apache.org/components/4.18.x/others/micrometer-observability.htmlSo I guess we should use
camel-quarkus-micrometer-observabilityas the name of the artifact id but maybe mention the number 2 in the doc pageThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noticed that the name is mentioning the number 2 https://github.com/apache/camel-quarkus/pull/8879/changes#diff-fe415796d03d04abe70a35bf7672d65cea6b509838d0ec238b2987804446724eR11