59.3. 사용법


확장 기능은 Camel OpenTelemetryTracer 를 자동으로 생성하여 Camel 레지스트리에 바인딩합니다.

캡처된 추적을 추적 시스템으로 보내려면 아래와 같이 application.properties 내에서 일부 속성을 구성해야 합니다.

# Identifier for the origin of spans created by the application
quarkus.application.name=my-camel-application

# For OTLP
quarkus.opentelemetry.tracer.exporter.otlp.endpoint=http://localhost:4317

# For Jaeger
quarkus.opentelemetry.tracer.exporter.jaeger.endpoint=http://localhost:14250
Copy to Clipboard Toggle word wrap

작업하려는 OpenTelemetry 내보내기에 종속성을 추가해야 합니다.

현재 Quarkus는 Jaeger 및 OpenTelemetry Protocol Specification(OTLP)을 지원합니다.

Jaeger의 경우:

<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-opentelemetry-exporter-jaeger</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

OTLP의 경우:

<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-opentelemetry-exporter-otlp</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

전체 구성 옵션 목록은 Quarkus OpenTelemetry 가이드를 참조하십시오.

application.properties 에서 quarkus.camel.opentelemetry.exclude-patterns 라는 속성을 구성하여 경로 끝점을 추적에서 제외할 수 있습니다. 예를 들면 다음과 같습니다.

# Exclude all direct & netty-http endpoints from tracing
quarkus.camel.opentelemetry.exclude-patterns=direct:*,netty-http:*
Copy to Clipboard Toggle word wrap

59.3.1. CDI 8080 메서드 실행 추적

Camel 경로에서 CDI Quarkus 메서드를 실행할 때 io.opentelemetry.extension.annotations.WithSpan. @WithSpan 으로 주석이 달린 메서드는 새 Span을 생성하고 현재 추적 컨텍스트와 필요한 모든 관계를 설정합니다.

예를 들어 Camel 경로에서 CDI 빈을 조정하려면 먼저 @WithTrace 를 사용하여 적절한 메서드에 주석을 답니다.

@ApplicationScoped
@Named("myBean")
public class MyBean {
    @WithSpan
    public String greet() {
        return "Hello World!";
    }
}
Copy to Clipboard Toggle word wrap

다음으로 Camel 경로의 빈을 사용합니다.

중요

기록된 범위의 시퀀스가 올바른지 확인하려면 단축된 .bean() EIP DSL 메서드 대신 full to("bean:") 엔드포인트 URI를 사용해야 합니다.

public class MyRoutes extends RouteBuilder {
    @Override
    public void configure() throws Exception {
        from("direct:executeBean")
                .to("bean:myBean?method=greet");
    }
}
Copy to Clipboard Toggle word wrap

Quarkus OpenTelemetry 가이드 의 CDI 조정에 대한 자세한 정보가 있습니다.

맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

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

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

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

Red Hat 소개

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

Theme

© 2025 Red Hat