Demo project that shows how to enable tracing in Spring application using OpenTracing and Jaeger Tracer
- Local Jaeger server with running Collector
- Local RabbitMQ server available on default port
All services are simple Spring Boot applications
- First service receives HTTP requests from user and just sends new HTTP requests to 2nd service. It uses RestController and RestTemplate from Spring. Tracing is implemented with OpenTracing Spring Web Instrumentation and Java Jaeger Client.
- Second service receives HTTP request from 1st service and then sends a message to RabbitMQ queue. It uses RabbitTemplate and RabbitListener to send and receive AMQP messages. Tracing is implemented with OpenTracing Spring RabbitMQ Instrumentation.
After receiving message from RabbitMQ it sends HTTP request to 3rd service using OkHttp client. Tracing is implemented without special instrumentation (manually creating new span, setting tags and injecting span to request headers). - Third service just receives HTTP request from 2rd service and trace it without instrumentation (manual span extraction from request header).
- Start local RabbitMQ server
- Start Jaeger
- Start all Spring Boot applications
- Send GET request to http://localhost:8081/amqp
- See the trace on Jaeger UI (http://localhost:16686/)