文章目录
在OpenShift使用Jaeger对Spring Boot / Spring Cloud应用作分布式服务跟踪
前言
本文描述了在OpenShift中使用Jaeger对Spring Boot / Spring Cloud应用作分布式服务跟踪。
关于Jaeger
Jaeger是一个优秀的基于OpenTracing的分布式服务跟踪系统。
参见:
在Spring Boot应用中用Jaeger作服务跟踪
如果服务间依赖只用了RestTemplate,可以只引入opentracing-spring-jaeger-web-starter
依赖。
The
opentracing-spring-jaeger-web-starter
starter is convenience starter that includes bothopentracing-spring-jaeger-starter
andopentracing-spring-web-starter
This means that by including it, simple web Spring Boot microservices include all the necessary dependencies to instrument Web requests / responses and send traces to Jaeger.
添加Maven依赖:
<dependency>
<groupId>io.opentracing.contrib</groupId>
<artifactId>opentracing-spring-jaeger-web-starter</artifactId>
<version>3.2.2</version>
</dependency>
无需代码改动,已完成在应用添加OpenTracing Jaeger支持。
OpenTracing Jaeger的本地配置为:
opentracing: