59.3. 사용법
확장 기능은 Camel OpenTelemetryTracer
를 자동으로 생성하여 Camel 레지스트리에 바인딩합니다.
캡처된 추적을 추적 시스템으로 보내려면 아래와 같이 application.properties
내에서 일부 속성을 구성해야 합니다.
작업하려는 OpenTelemetry 내보내기에 종속성을 추가해야 합니다.
현재 Quarkus는 Jaeger 및 OpenTelemetry Protocol Specification(OTLP)을 지원합니다.
Jaeger의 경우:
<dependency> <groupId>io.quarkus</groupId> <artifactId>quarkus-opentelemetry-exporter-jaeger</artifactId> </dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-opentelemetry-exporter-jaeger</artifactId>
</dependency>
OTLP의 경우:
<dependency> <groupId>io.quarkus</groupId> <artifactId>quarkus-opentelemetry-exporter-otlp</artifactId> </dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-opentelemetry-exporter-otlp</artifactId>
</dependency>
전체 구성 옵션 목록은 Quarkus OpenTelemetry 가이드를 참조하십시오.
application.properties
에서 quarkus.camel.opentelemetry.exclude-patterns
라는 속성을 구성하여 경로 끝점을 추적에서 제외할 수 있습니다. 예를 들면 다음과 같습니다.
Exclude all direct & netty-http endpoints from tracing
# Exclude all direct & netty-http endpoints from tracing
quarkus.camel.opentelemetry.exclude-patterns=direct:*,netty-http:*
59.3.1. CDI 8080 메서드 실행 추적 링크 복사링크가 클립보드에 복사되었습니다!
Camel 경로에서 CDI Quarkus 메서드를 실행할 때 io.opentelemetry.extension.annotations.WithSpan
. @WithSpan
으로 주석이 달린 메서드는 새 Span을 생성하고 현재 추적 컨텍스트와 필요한 모든 관계를 설정합니다.
예를 들어 Camel 경로에서 CDI 빈을 조정하려면 먼저 @WithTrace
를 사용하여 적절한 메서드에 주석을 답니다.
다음으로 Camel 경로의 빈을 사용합니다.
기록된 범위의 시퀀스가 올바른지 확인하려면 단축된 .bean()
EIP DSL 메서드 대신 full to("bean:")
엔드포인트 URI를 사용해야 합니다.
Quarkus OpenTelemetry 가이드 의 CDI 조정에 대한 자세한 정보가 있습니다.