I instrumented a simple Spring-Boot application with Jaeger, but when I run the application within a Docker container with docker-compose, I can't see any traces in the Jaeger frontend.
I'm creating the tracer configuration by reading the properties from environment variables that I set in the docker-compose file.
This is how I create the tracer:
Configuration config = Configuration.fromEnv();
return config.getTracer();
And this is my docker-compose file:
version: '2'
services:
demo:
build: opentracing_demo/.
ports:
- "8080:8080"
environment:
- JAEGER_SERVICE_NAME=hello_service
- JAEGER_AGENT_HOST=jaeger
- JAEGER_AGENT_PORT=6831
jaeger:
image: jaegertracing/all-in-one:latest
ports:
- "5775:5775/udp"
- "6831:6831/udp"
- "6832:6832/udp"
- "5778:5778"
- "16686:16686"
- "14268:14268"
- "9411:9411"
You can also find my project on GitHub.
What am I doing wrong?
I found the solution to my problem, in case anybody is facing similar issues.
I was missing the environment variable JAEGER_SAMPLER_MANAGER_HOST_PORT, which is necessary if the (default) remote controlled sampler is used for tracing.
This is the working docker-compose file:
version: '2'
services:
demo:
build: opentracing_demo/.
ports:
- "8080:8080"
environment:
- JAEGER_SERVICE_NAME=hello_service
- JAEGER_AGENT_HOST=jaeger
- JAEGER_AGENT_PORT=6831
- JAEGER_SAMPLER_MANAGER_HOST_PORT=jaeger:5778
jaeger:
image: jaegertracing/all-in-one:latest
ports:
- "5775:5775/udp"
- "6831:6831/udp"
- "6832:6832/udp"
- "5778:5778"
- "16686:16686"
- "14268:14268"
- "9411:9411"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With