io.opentracing.contrib:opentracing-spring-cloud-rxjava-starter

OpenTracing instrumentation for Spring Cloud

License

License

Categories

Categories

RxJava Container Microservices Reactive libraries
GroupId

GroupId

io.opentracing.contrib
ArtifactId

ArtifactId

opentracing-spring-cloud-rxjava-starter
Last Version

Last Version

0.5.9
Release Date

Release Date

Type

Type

jar
Description

Description

OpenTracing instrumentation for Spring Cloud

Download opentracing-spring-cloud-rxjava-starter

How to add to project

<!-- https://jarcasting.com/artifacts/io.opentracing.contrib/opentracing-spring-cloud-rxjava-starter/ -->
<dependency>
    <groupId>io.opentracing.contrib</groupId>
    <artifactId>opentracing-spring-cloud-rxjava-starter</artifactId>
    <version>0.5.9</version>
</dependency>
// https://jarcasting.com/artifacts/io.opentracing.contrib/opentracing-spring-cloud-rxjava-starter/
implementation 'io.opentracing.contrib:opentracing-spring-cloud-rxjava-starter:0.5.9'
// https://jarcasting.com/artifacts/io.opentracing.contrib/opentracing-spring-cloud-rxjava-starter/
implementation ("io.opentracing.contrib:opentracing-spring-cloud-rxjava-starter:0.5.9")
'io.opentracing.contrib:opentracing-spring-cloud-rxjava-starter:jar:0.5.9'
<dependency org="io.opentracing.contrib" name="opentracing-spring-cloud-rxjava-starter" rev="0.5.9">
  <artifact name="opentracing-spring-cloud-rxjava-starter" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.opentracing.contrib', module='opentracing-spring-cloud-rxjava-starter', version='0.5.9')
)
libraryDependencies += "io.opentracing.contrib" % "opentracing-spring-cloud-rxjava-starter" % "0.5.9"
[io.opentracing.contrib/opentracing-spring-cloud-rxjava-starter "0.5.9"]

Dependencies

compile (5)

Group / Artifact Type Version
org.springframework.boot : spring-boot-autoconfigure jar
io.opentracing.contrib : opentracing-spring-tracer-configuration-starter jar 0.3.1
io.opentracing.contrib : opentracing-rxjava-1 jar 0.1.3
io.reactivex : rxjava Optional jar
io.opentracing : opentracing-api jar 0.33.0

test (7)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter-test jar
org.springframework.boot : spring-boot-starter-web jar
org.springframework.cloud : spring-cloud-starter-netflix-hystrix jar
io.opentracing.contrib : opentracing-spring-web-starter jar 4.1.0
io.opentracing : opentracing-mock jar 0.33.0
io.opentracing : opentracing-util test-jar 0.33.0
org.awaitility : awaitility jar 3.0.0

Project Modules

There are no modules declared in this project.

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

Configuration

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:

<dependency>
  <groupId>io.opentracing.contrib</groupId>
  <artifactId>opentracing-spring-cloud-starter</artifactId>
</dependency>

, and provide OpenTracing tracer bean:

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

Properties

Property Default Description
opentracing.spring.cloud.reactor.enabled true Enable Reactor tracing.
opentracing.spring.cloud.async.enabled true Enable tracing for @Async, Executor and WebAsyncTask/Callable.
opentracing.spring.cloud.log.enabled true Add standard logging output to tracing system.
opentracing.spring.cloud.scheduled.enabled true Enable @Scheduled tracing.
opentracing.spring.cloud.feign.enabled true Enable Feign tracing.
opentracing.spring.cloud.gateway.enabled true Enable Gateway tracing.
opentracing.spring.cloud.hystrix.strategy.enabled true Enable Propagation of spans across threads using in Hystrix command tracing.
opentracing.spring.cloud.jdbc.enabled true Enable JDBC tracing.
opentracing.spring.cloud.jms.enabled true Enable JMS tracing.
opentracing.spring.cloud.kafka.enabled true Enable Kafka tracing.
opentracing.spring.cloud.mongo.enabled true Enable MongoDB tracing.
opentracing.spring.cloud.reactor.enabled true Enable Reactor tracing.
opentracing.spring.cloud.rxjava.enabled true Enable RxJava tracing.
opentracing.spring.cloud.websocket.enabled true Enable Websocket tracing.
opentracing.spring.cloud.zuul.enabled true Enable Zuul tracing.
opentracing.spring.cloud.redis.enabled true Enable Redis tracing.
opentracing.spring.cloud.redis.prefixOperationName "" Set a prefix for each Redis operation, e.g: MyPrefix.SET.
opentracing.spring.cloud.jdbc.withActiveSpanOnly false Only trace JDBC calls if they are part of an active Span.
opentracing.spring.cloud.jdbc.ignoreStatements null Set of JDBC statements to not trace.

Development

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

Release

Follow instructions in RELEASE

License

Apache 2.0 License.

io.opentracing.contrib

3rd-Party OpenTracing API Contributions

3rd-party contributions that use OpenTracing. **The repositories in this org are *not* affiliated with the CNCF.**

Versions

Version
0.5.9
0.5.8
0.5.7
0.5.6
0.5.5
0.5.4
0.5.3
0.5.1
0.5.0
0.4.0
0.3.12
0.3.11
0.3.10
0.3.9
0.3.8
0.3.7
0.3.6
0.3.5
0.3.4
0.3.2
0.3.1
0.3.0
0.2.6
0.2.5
0.2.4
0.2.3
0.2.2
0.2.1
0.2.0
0.1.17
0.1.16
0.1.15
0.1.14