Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tracing with Jaeger doesn't work with docker-compose

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?

like image 560
TheManawaha Avatar asked May 04 '18 11:05

TheManawaha


1 Answers

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"
like image 56
TheManawaha Avatar answered Oct 26 '22 00:10

TheManawaha