You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "beskow (via GitHub)" <gi...@apache.org> on 2026/04/17 15:33:59 UTC

[PR] Using OpenTelemetry instrumentation via Spring Boot starter and OpenTelemetry2 [camel]

beskow opened a new pull request, #22675:
URL: https://github.com/apache/camel/pull/22675

   # Description
   
   Document how to configure and use opentelemetry-spring-boot-starter as an alternative to the OpenTelemetry agent (see https://issues.apache.org/jira/browse/CAMEL-23343).
   
   # Target
   
   - [x] I checked that the commit is targeting the correct branch (Camel 4 uses the `main` branch)
   
   # Tracking
   - [x] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it).
   
   # Apache Camel coding standards and style
   
   - [x] I checked that each commit in the pull request has a meaningful subject line and body.
   
   - [x] I have run `mvn clean install -DskipTests` locally from root folder and I have committed all auto-generated changes.
   


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Using OpenTelemetry instrumentation via Spring Boot starter and OpenTelemetry2 [camel]

Posted by "beskow (via GitHub)" <gi...@apache.org>.
beskow commented on code in PR #22675:
URL: https://github.com/apache/camel/pull/22675#discussion_r3113013997


##########
components/camel-opentelemetry2/src/main/docs/opentelemetry2.adoc:
##########
@@ -110,6 +110,78 @@ As an alternative, you can use the agent's built-in MDC integration.
 . Enable the https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/logger-mdc-instrumentation.md[Logger MDC auto-instrumentation]. This automatically adds `trace_id` and `span_id` to the MDC.
 . Configure your logging framework to include these MDC keys in your log format. The exact configuration depends on the logging library you use.
 
+[[OpenTelemetry-SpringBoot-starter]]
+=== Using the OpenTelemetry Spring Boot starter
+
+An alternative to the OpenTelemetry agent is to use https://opentelemetry.io/docs/zero-code/java/spring-boot-starter/[OpenTelemetry Spring Boot starter].
+
+To ensure version alignment across all OpenTelemetry dependencies, you should
+import the opentelemetry-instrumentation-bom BOM:
+
+[source,xml]
+----
+<dependencyManagement>
+    <dependencies>
+        <dependency>
+            <groupId>io.opentelemetry.instrumentation</groupId>
+            <artifactId>opentelemetry-instrumentation-bom</artifactId>
+            <version>2.26.1</version>

Review Comment:
   Good point, I'll have added that!



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Using OpenTelemetry instrumentation via Spring Boot starter and OpenTelemetry2 [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #22675:
URL: https://github.com/apache/camel/pull/22675#issuecomment-4275445323

   <!-- ci-tested-modules -->
   :test_tube: **CI tested the following changed modules:**
   
   - `components/camel-opentelemetry2`
   
   <details><summary>All tested modules (8 modules)</summary>
   
   - Camel :: JBang :: MCP
   - Camel :: JBang :: Plugin :: Route Parser
   - Camel :: JBang :: Plugin :: Validate
   - Camel :: Launcher :: Container
   - Camel :: Observability Services
   - Camel :: Opentelemetry 2
   - Camel :: YAML DSL :: Validator
   - Camel :: YAML DSL :: Validator Maven Plugin
   
   </details>
   
   ---
   :gear: [View full build and test results](https://github.com/apache/camel/actions/runs/24622770874)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Using OpenTelemetry instrumentation via Spring Boot starter and OpenTelemetry2 [camel]

Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez commented on code in PR #22675:
URL: https://github.com/apache/camel/pull/22675#discussion_r3115582583


##########
components/camel-opentelemetry2/src/main/docs/opentelemetry2.adoc:
##########
@@ -110,6 +110,82 @@ As an alternative, you can use the agent's built-in MDC integration.
 . Enable the https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/logger-mdc-instrumentation.md[Logger MDC auto-instrumentation]. This automatically adds `trace_id` and `span_id` to the MDC.
 . Configure your logging framework to include these MDC keys in your log format. The exact configuration depends on the logging library you use.
 
+[[OpenTelemetry-SpringBoot-starter]]
+=== Using the OpenTelemetry Spring Boot starter
+
+An alternative to the OpenTelemetry agent is to use https://opentelemetry.io/docs/zero-code/java/spring-boot-starter/[OpenTelemetry Spring Boot starter].
+
+To ensure version alignment across all OpenTelemetry dependencies, you should
+import the opentelemetry-instrumentation-bom BOM (choose a version that aligns with
+the Opentelemetry dependencies that are used within the given Camel version used).
+
+[source,xml]
+----
+<dependencyManagement>
+    <dependencies>
+        <dependency>
+            <groupId>io.opentelemetry.instrumentation</groupId>
+            <artifactId>opentelemetry-instrumentation-bom</artifactId>
+            <version>2.26.1</version>
+            <type>pom</type>
+            <scope>import</scope>
+        </dependency>
+    </dependencies>
+</dependencyManagement>
+----
+
+Note: Import the OpenTelemetry BOMs before any other BOMs in your project. For example, if you
+import the spring-boot-dependencies BOM, you have to declare it after the OpenTelemetry BOMs.

Review Comment:
   ```suggestion
   import the spring-boot-dependencies BOM, you have to declare it after the OpenTelemetry BOMs. Also make sure that the version you choose is compatible with the Opentelemetry version used by the Camel version you're using.
   ```



##########
components/camel-opentelemetry2/src/main/docs/opentelemetry2.adoc:
##########
@@ -110,6 +110,78 @@ As an alternative, you can use the agent's built-in MDC integration.
 . Enable the https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/logger-mdc-instrumentation.md[Logger MDC auto-instrumentation]. This automatically adds `trace_id` and `span_id` to the MDC.
 . Configure your logging framework to include these MDC keys in your log format. The exact configuration depends on the logging library you use.
 
+[[OpenTelemetry-SpringBoot-starter]]
+=== Using the OpenTelemetry Spring Boot starter
+
+An alternative to the OpenTelemetry agent is to use https://opentelemetry.io/docs/zero-code/java/spring-boot-starter/[OpenTelemetry Spring Boot starter].
+
+To ensure version alignment across all OpenTelemetry dependencies, you should
+import the opentelemetry-instrumentation-bom BOM:
+
+[source,xml]
+----
+<dependencyManagement>
+    <dependencies>
+        <dependency>
+            <groupId>io.opentelemetry.instrumentation</groupId>
+            <artifactId>opentelemetry-instrumentation-bom</artifactId>
+            <version>2.26.1</version>

Review Comment:
   Thanks, but I think that note is not enough. I'm adding a comment inline to show how I think it should be. Feel free to accept the inline change if you want.



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Using OpenTelemetry instrumentation via Spring Boot starter and OpenTelemetry2 [camel]

Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez commented on code in PR #22675:
URL: https://github.com/apache/camel/pull/22675#discussion_r3108818510


##########
components/camel-opentelemetry2/src/main/docs/opentelemetry2.adoc:
##########
@@ -110,6 +110,78 @@ As an alternative, you can use the agent's built-in MDC integration.
 . Enable the https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/logger-mdc-instrumentation.md[Logger MDC auto-instrumentation]. This automatically adds `trace_id` and `span_id` to the MDC.
 . Configure your logging framework to include these MDC keys in your log format. The exact configuration depends on the logging library you use.
 
+[[OpenTelemetry-SpringBoot-starter]]
+=== Using the OpenTelemetry Spring Boot starter
+
+An alternative to the OpenTelemetry agent is to use https://opentelemetry.io/docs/zero-code/java/spring-boot-starter/[OpenTelemetry Spring Boot starter].
+
+To ensure version alignment across all OpenTelemetry dependencies, you should
+import the opentelemetry-instrumentation-bom BOM:
+
+[source,xml]
+----
+<dependencyManagement>
+    <dependencies>
+        <dependency>
+            <groupId>io.opentelemetry.instrumentation</groupId>
+            <artifactId>opentelemetry-instrumentation-bom</artifactId>
+            <version>2.26.1</version>

Review Comment:
   Probably you want to set here a version compatible with the Opentelemetry dependencies that are used within a given Camel version used. We should add a note.



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Using OpenTelemetry instrumentation via Spring Boot starter and OpenTelemetry2 [camel]

Posted by "beskow (via GitHub)" <gi...@apache.org>.
beskow commented on code in PR #22675:
URL: https://github.com/apache/camel/pull/22675#discussion_r3106384172


##########
components/camel-opentelemetry2/src/main/docs/opentelemetry2.adoc:
##########
@@ -110,6 +110,78 @@ As an alternative, you can use the agent's built-in MDC integration.
 . Enable the https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/logger-mdc-instrumentation.md[Logger MDC auto-instrumentation]. This automatically adds `trace_id` and `span_id` to the MDC.
 . Configure your logging framework to include these MDC keys in your log format. The exact configuration depends on the logging library you use.
 
+[[OpenTelemetry-SpringBoot-starter]]
+=== Using the OpenTelemetry Spring Boot starter
+
+An alternative to the OpenTelemetry agent is to use https://opentelemetry.io/docs/zero-code/java/spring-boot-starter/[OpenTelemetry Spring Boot starter].
+
+To ensure version alignment across all OpenTelemetry dependencies, you should
+import the opentelemetry-instrumentation-bom BOM:
+
+[source,xml]
+----
+<dependencyManagement>
+    <dependencies>
+        <dependency>
+            <groupId>io.opentelemetry.instrumentation</groupId>
+            <artifactId>opentelemetry-instrumentation-bom</artifactId>
+            <version>2.26.1</version>
+            <type>pom</type>
+            <scope>import</scope>
+        </dependency>
+    </dependencies>
+</dependencyManagement>
+----
+
+Then add the following dependency for the OpenTelemetry Spring Boot starter:
+
+[source,xml]
+----
+<dependency>
+    <groupId>io.opentelemetry.instrumentation</groupId>
+    <artifactId>opentelemetry-spring-boot-starter</artifactId>
+</dependency>
+----
+
+The starter auto-configures most aspects of the OpenTelemetry instrumentation, with two exceptions:
+No `Tracer` or ContextPropagators` beans are autoconfigured, they need to be configured manually:

Review Comment:
   Thanks, fixed!



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Using OpenTelemetry instrumentation via Spring Boot starter and OpenTelemetry2 [camel]

Posted by "beskow (via GitHub)" <gi...@apache.org>.
beskow commented on code in PR #22675:
URL: https://github.com/apache/camel/pull/22675#discussion_r3116173703


##########
components/camel-opentelemetry2/src/main/docs/opentelemetry2.adoc:
##########
@@ -110,6 +110,78 @@ As an alternative, you can use the agent's built-in MDC integration.
 . Enable the https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/logger-mdc-instrumentation.md[Logger MDC auto-instrumentation]. This automatically adds `trace_id` and `span_id` to the MDC.
 . Configure your logging framework to include these MDC keys in your log format. The exact configuration depends on the logging library you use.
 
+[[OpenTelemetry-SpringBoot-starter]]
+=== Using the OpenTelemetry Spring Boot starter
+
+An alternative to the OpenTelemetry agent is to use https://opentelemetry.io/docs/zero-code/java/spring-boot-starter/[OpenTelemetry Spring Boot starter].
+
+To ensure version alignment across all OpenTelemetry dependencies, you should
+import the opentelemetry-instrumentation-bom BOM:
+
+[source,xml]
+----
+<dependencyManagement>
+    <dependencies>
+        <dependency>
+            <groupId>io.opentelemetry.instrumentation</groupId>
+            <artifactId>opentelemetry-instrumentation-bom</artifactId>
+            <version>2.26.1</version>

Review Comment:
   Sure! I had added the same info in the paragraph above, but it might be more clear the way you suggested. Now applied, thanks!



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Using OpenTelemetry instrumentation via Spring Boot starter and OpenTelemetry2 [camel]

Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez merged PR #22675:
URL: https://github.com/apache/camel/pull/22675


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Using OpenTelemetry instrumentation via Spring Boot starter and OpenTelemetry2 [camel]

Posted by "beskow (via GitHub)" <gi...@apache.org>.
beskow commented on code in PR #22675:
URL: https://github.com/apache/camel/pull/22675#discussion_r3116173703


##########
components/camel-opentelemetry2/src/main/docs/opentelemetry2.adoc:
##########
@@ -110,6 +110,78 @@ As an alternative, you can use the agent's built-in MDC integration.
 . Enable the https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/logger-mdc-instrumentation.md[Logger MDC auto-instrumentation]. This automatically adds `trace_id` and `span_id` to the MDC.
 . Configure your logging framework to include these MDC keys in your log format. The exact configuration depends on the logging library you use.
 
+[[OpenTelemetry-SpringBoot-starter]]
+=== Using the OpenTelemetry Spring Boot starter
+
+An alternative to the OpenTelemetry agent is to use https://opentelemetry.io/docs/zero-code/java/spring-boot-starter/[OpenTelemetry Spring Boot starter].
+
+To ensure version alignment across all OpenTelemetry dependencies, you should
+import the opentelemetry-instrumentation-bom BOM:
+
+[source,xml]
+----
+<dependencyManagement>
+    <dependencies>
+        <dependency>
+            <groupId>io.opentelemetry.instrumentation</groupId>
+            <artifactId>opentelemetry-instrumentation-bom</artifactId>
+            <version>2.26.1</version>

Review Comment:
   Sure! I had added the same info in the paragraph above, but it might be more clear the way you suggested. Thanks!



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Using OpenTelemetry instrumentation via Spring Boot starter and OpenTelemetry2 [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #22675:
URL: https://github.com/apache/camel/pull/22675#discussion_r3101509034


##########
components/camel-opentelemetry2/src/main/docs/opentelemetry2.adoc:
##########
@@ -110,6 +110,78 @@ As an alternative, you can use the agent's built-in MDC integration.
 . Enable the https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/logger-mdc-instrumentation.md[Logger MDC auto-instrumentation]. This automatically adds `trace_id` and `span_id` to the MDC.
 . Configure your logging framework to include these MDC keys in your log format. The exact configuration depends on the logging library you use.
 
+[[OpenTelemetry-SpringBoot-starter]]
+=== Using the OpenTelemetry Spring Boot starter
+
+An alternative to the OpenTelemetry agent is to use https://opentelemetry.io/docs/zero-code/java/spring-boot-starter/[OpenTelemetry Spring Boot starter].
+
+To ensure version alignment across all OpenTelemetry dependencies, you should
+import the opentelemetry-instrumentation-bom BOM:
+
+[source,xml]
+----
+<dependencyManagement>
+    <dependencies>
+        <dependency>
+            <groupId>io.opentelemetry.instrumentation</groupId>
+            <artifactId>opentelemetry-instrumentation-bom</artifactId>
+            <version>2.26.1</version>
+            <type>pom</type>
+            <scope>import</scope>
+        </dependency>
+    </dependencies>
+</dependencyManagement>
+----
+
+Then add the following dependency for the OpenTelemetry Spring Boot starter:
+
+[source,xml]
+----
+<dependency>
+    <groupId>io.opentelemetry.instrumentation</groupId>
+    <artifactId>opentelemetry-spring-boot-starter</artifactId>
+</dependency>
+----
+
+The starter auto-configures most aspects of the OpenTelemetry instrumentation, with two exceptions:
+No `Tracer` or ContextPropagators` beans are autoconfigured, they need to be configured manually:

Review Comment:
   Missing a quote here



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Using OpenTelemetry instrumentation via Spring Boot starter and OpenTelemetry2 [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #22675:
URL: https://github.com/apache/camel/pull/22675#issuecomment-4275419232

   :star2: Thank you for your contribution to the Apache Camel project! :star2:
     :robot: CI automation will test this PR automatically.
   
     :camel: Apache Camel Committers, please review the following items:
   
     * First-time contributors **require MANUAL approval** for the GitHub Actions to run
     * You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
     * You can label PRs using `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
     * Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
     
     :warning: Be careful when sharing logs. Review their contents before sharing them publicly.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org