使用 Jaeger 跟踪 Apache Camel 路由
Tracing Apache Camel route with Jaeger
我用 Spring Boot 开发了一个 Camel 路由。现在我想使用 Jaeger 追踪路线。我尝试 this example 使用 camel-opentracing
组件追踪路线,但我无法追踪到 Jaeger。
我只能在控制台中看到它。我不清楚的一件事是在哪里添加 Jaeger URL?
任何工作示例都会有所帮助。
我最终做的是创建一个 JaegerTraces 并用 Bean 注释
Apache Camel 不提供 OpenTracing, so you have to add also an implementation to your dependencies. For example Jaeger.
的实现
Maven POM:
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-opentracing-starter</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>io.opentracing.contrib</groupId>
<artifactId>opentracing-spring-jaeger-starter</artifactId>
<version>3.2.2</version>
</dependency>
您还必须在 Spring 引导应用程序 class 上为 Apache Camel 启用 OpenTracing,请参阅 Spring Boot:
If you are using Spring Boot then you can add the camel-opentracing-starter
dependency, and turn on OpenTracing by annotating the main class with @CamelOpenTracing
.
The Tracer will be implicitly obtained from the camel context’s Registry, or the ServiceLoader, unless a Tracer bean has been defined by the application.
Spring 引导应用程序 class:
@SpringBootApplication
@CamelOpenTracing
public class CamelApplication {
public static void main(String[] args) {
SpringApplication.run(CamelApplication.class, args);
}
}
我用 Spring Boot 开发了一个 Camel 路由。现在我想使用 Jaeger 追踪路线。我尝试 this example 使用 camel-opentracing
组件追踪路线,但我无法追踪到 Jaeger。
我只能在控制台中看到它。我不清楚的一件事是在哪里添加 Jaeger URL? 任何工作示例都会有所帮助。
我最终做的是创建一个 JaegerTraces 并用 Bean 注释
Apache Camel 不提供 OpenTracing, so you have to add also an implementation to your dependencies. For example Jaeger.
的实现Maven POM:
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-opentracing-starter</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>io.opentracing.contrib</groupId>
<artifactId>opentracing-spring-jaeger-starter</artifactId>
<version>3.2.2</version>
</dependency>
您还必须在 Spring 引导应用程序 class 上为 Apache Camel 启用 OpenTracing,请参阅 Spring Boot:
If you are using Spring Boot then you can add the
camel-opentracing-starter
dependency, and turn on OpenTracing by annotating the main class with@CamelOpenTracing
.The Tracer will be implicitly obtained from the camel context’s Registry, or the ServiceLoader, unless a Tracer bean has been defined by the application.
Spring 引导应用程序 class:
@SpringBootApplication
@CamelOpenTracing
public class CamelApplication {
public static void main(String[] args) {
SpringApplication.run(CamelApplication.class, args);
}
}