Since Camel 3.5

The OpenTelemetry component is used for tracing and timing incoming and outgoing Camel messages using OpenTelemetry.

Events (spans) are captured for incoming and outgoing messages being sent to/from Camel.


The configuration properties for the OpenTelemetry tracer are:

Option Default Description


Sets exclude pattern(s) that will disable tracing for Camel messages that matches the pattern. The content is a Set<String> where the key is a pattern. The pattern uses the rules from Intercept.



Sets whether the header keys need to be encoded (connector specific) or not. The value is a boolean. Dashes need for instances to be encoded for JMS property keys.


Include the camel-opentelemetry component in your POM, along with any specific dependencies associated with the chosen OpenTelemetry compliant Tracer.

To explicitly configure OpenTelemetry support, instantiate the OpenTelemetryTracer and initialize the camel context. You can optionally specify a Tracer, or alternatively it can be implicitly discovered using the Registry

OpenTelemetryTracer otelTracer = new OpenTelemetryTracer();
// By default it uses the DefaultTracer, but you can override it with a specific OpenTelemetry Tracer implementation.
// And then initialize the context

Spring Boot Auto-Configuration

When using opentelemetry with Spring Boot make sure to use the following Maven dependency to have support for auto configuration:

  <!-- use the same version as your Camel core version -->

The component supports 2 options, which are listed below.

Name Description Default Type


Activate or deactivate dash encoding in headers (required by JMS) for messaging.



Sets exclude pattern(s) that will disable tracing for Camel messages that matches the pattern.


MDC Logging

When MDC Logging is enabled for the active Camel context the Trace ID and Span ID will be added and removed from the MDC for each route, the keys are traceId and spanId, respectively.