In this example we are running 2 services:
- hello-service
- greetings-service
Both are using java-spring-jaeger by including the following dependency
<dependency>
<groupId>io.opentracing.contrib</groupId>
<artifactId>opentracing-spring-jaeger-web-starter</artifactId>
<version>1.0.3</version>
</dependency>
Hello service will run on port 8888 and exposes the enpoint /hello. This endpoint returns the String "Hello from Service"
Greetings service will run on port 8080 and exposes the enpoint /greetings/hello. When calling this endpoint, this service calls the hello-service and returns the String received in the response.
When a request is processed, traces are sent to the Jaeger tool, where you get a detailed view of the process. You can access the Jaeger UI via the following link http://localhost:16686/
Example can be run with docker-compose. Build:
docker-compose build
Run:
docker-compose up
Call endpoint: http://localhost:8080/greetings/hello
and you will see the traces by accessing to Jaeger at http://localhost:16686/