Awesome Open Source
Awesome Open Source

Build Status Released Version

OpenTracing Spring Cloud

This repository provides OpenTracing instrumentation for Spring Boot and its various extensions. It can be used with any OpenTracing compatible implementation.

It contains auto-configurations which instruments and trace following Spring Boot projects:

  • Spring Web (RestControllers, RestTemplates, WebAsyncTask, WebClient, WebFlux)
  • @Async, @Scheduled, Executors
  • WebSocket STOMP
  • Feign, HystrixFeign
  • Hystrix
  • JMS
  • JDBC
  • Kafka
  • Mongo
  • Zuul
  • Reactor
  • RxJava
  • Redis
  • Standard logging - logs are added to active span
  • Spring Messaging - trace messages being sent through Messaging Channels
  • RabbitMQ

Compatibility table

The following table shows versions with compatible Spring Cloud releases.

opentracing-spring-cloud version OpenTracing API Spring Cloud version
0.5.x 0.33.0 Hoxton
0.4.x 0.32.0 Hoxton
0.3.x 0.32.0 Greenwich
0.2.x 0.31.0 Finchley, Greenwich
0.1.x 0.31.0 Dalston, Edgware

Comparison to spring-cloud-sleuth

This project is similar to spring-cloud-sleuth, both provide out of the box tracing solution for Spring Boot/Cloud. Some of the instrumentations in this package are based on original sleuth work.

However there are a couple of differences:

  • OpenTracing support in sleuth is limited to only one tracer implementation - brave-opentracing. In other words it's not possible to use arbitrary OpenTracing tracer with sleuth.
  • sleuth might support different set of instrumentations.
  • Instrumentations in sleuth might add different set of tags and logs to represent the same events.

Note on dependencies

It's worth noting that the although OpenTracing Spring Cloud contains code for instrumenting a wealth of Spring projects, it however does not pull those dependencies automatically, marking them as optional dependencies instead.

That means that for example a simple Spring Boot REST API application can include OpenTracing Spring Cloud without the fear of polluting the classpath with Spring Cloud dependencies that are otherwise unneeded


The preferred way to use this library is via vendored starters. These starters use instrumentations from this library and expose specific tracer configuration in Spring native way:

Explicitly tracer configuration

Just add the following dependency in your pom.xml:


, and provide OpenTracing tracer bean:

public io.opentracing.Tracer tracer() {
  return new // tracer instance of your choice (Zipkin, Jaeger, LightStep)


Property Default Description true Enable Reactor tracing. true Enable tracing for @Async, Executor and WebAsyncTask/Callable. true Add standard logging output to tracing system. true Enable @Scheduled tracing. true Enable Feign tracing. true Enable Gateway tracing. true Enable Propagation of spans across threads using in Hystrix command tracing. true Enable JDBC tracing. true Enable JMS tracing. true Enable Kafka tracing. true Enable MongoDB tracing. true Enable Reactor tracing. true Enable RxJava tracing. true Enable Websocket tracing. true Enable Zuul tracing. true Enable Redis tracing. "" Set a prefix for each Redis operation, e.g: MyPrefix.SET. false Only trace JDBC calls if they are part of an active Span. null Set of JDBC statements to not trace.


Maven checkstyle plugin is used to maintain consistent code style based on Google Style Guides

./mvnw clean install
make // to run tests including dependency tests, a specific profile can be specified by make PROFILES=nodeps


Follow instructions in RELEASE


Apache 2.0 License.

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Java (698,605
Mongodb (14,743
Spring Boot (12,503
Microservice (5,990
Websocket (5,454
Spring (5,047
Spring Cloud (1,672
Rxjava (1,319
Starter (1,278
Jdbc (901
Tracing (639
Opentracing (392
Instrumentation (355
Hystrix (240
Zuul (206
Feign (162
Jms (158
Resttemplate (43
Spring Messaging (8
Spring Stream (2
Related Projects