이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 93. OpenTelemetry


Since Camel 3.5

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

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

93.1. Dependencies

Add the following dependency to your pom.xml for this component:

<dependency>
  <groupId>org.apache.camel.springboot</groupId>
  <artifactId>camel-opentelemetry-starter</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

93.2. Configuration

The configuration properties for the OpenTelemetry tracer are:

Expand
OptionDefaultDescription

excludePatterns

 

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.

encoding

false

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.

93.2.1. Configuration

Add the camel-opentelemetry component in your POM, in addition to 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.
otelTracer.setTracer(...);
// And then initialize the context
otelTracer.init(camelContext);
Copy to Clipboard Toggle word wrap

93.3. Spring Boot

Add the camel-opentelemetry-starter dependency, and then turn on the OpenTracing by annotating the main class with @CamelOpenTelemetry.

The OpenTelemetryTracer is implicitly obtained from the camel context’s Registry, unless a OpenTelemetryTracer bean has been defined by the application.

93.4. Java Agent

Download the latest version of Java agent.

This package includes the instrumentation agent as well as instrumentations for all supported libraries and all available data exporters. The package provides a completely automatic, out-of-the-box experience.

Enable the instrumentation agent using the -javaagent flag to the JVM.

java -javaagent:path/to/opentelemetry-javaagent.jar \
     -jar myapp.jar
Copy to Clipboard Toggle word wrap

By default, the OpenTelemetry Java agent uses OTLP exporter configured to send data to OpenTelemetry collector at http://localhost:4317.

Configuration parameters are passed as Java system properties (-D flags) or as environment variables. See Configuring the agent and OpenTelemetry auto-configurationfor the full list of configuration items. For example:

java -javaagent:path/to/opentelemetry-javaagent.jar \
     -Dotel.service.name=your-service-name \
     -Dotel.traces.exporter=jaeger \
     -jar myapp.jar
Copy to Clipboard Toggle word wrap

93.5. Spring Boot Auto-Configuration

The component supports 2 options, which are listed below.

Expand
NameDescriptionDefaultType

camel.opentelemetry.encoding

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

 

Boolean

camel.opentelemetry.exclude-patterns

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

 

Set

93.6. MDC Logging

When MDC Logging is enabled for the active Camel context, the Trace ID and Span ID are added and removed from the MDC for each route, where the keys are trace_id and span_id, respectively.

맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2026 Red Hat