3
votes

I am trying to integrate jaeger tracing in my java spring application. I have added following code in the configuration file :

@Bean public io.opentracing.Tracer jaegerTracer(){

    Sender sender = new HttpSender("http://localhost:14268/api/traces");
    com.uber.jaeger.Configuration.SenderConfiguration senderConfiguration = new com.uber.jaeger.Configuration
            .SenderConfiguration.Builder()
            .sender(sender)
            .build();

    return new com.uber.jaeger.Configuration("pilot-tracking",
            new com.uber.jaeger.Configuration.SamplerConfiguration(ProbabilisticSampler.TYPE, 1),
            new com.uber.jaeger.Configuration.ReporterConfiguration(sender)).getTracer();
}

and used following docker command :

docker run -d -p 5775:5775/udp -p 6831:6831/udp -p 6832:6832/udp -p 5778:5778 -p 16686:16686 -p 14268:14268 jaegertracing/all-in-one:latest

Still, I am not able to find my service in jaeger-ui

Upon hitting this url : http://localhost:5778/?service=pilot-tracking Output is : tcollector error: tchannel error ErrCodeBadRequest: no handler for service "jaeger-collector" and method "SamplingManager::getSamplingStrategy"

Please help!!

1
Did you manage to find the issue and solve it?Sam Daniel

1 Answers

0
votes

This seems a bit old and it's a bit hard to tell what's wrong. My first guess would be the sampling strategy, as Jaeger samples one trace in one thousand, but looks like you did set it.

JAEGER_SAMPLER_TYPE=const JAEGER_SAMPLER_PARAM=1

I would recommend you start by using a simple Configuration.fromEnv().getTracer() to get your tracer. Then, control it via env vars, probably setting JAEGER_REPORTER_LOG_SPANS to true. With this option, you should be able to see in the logs whenever Jaeger emits a span.

You can also set the --log-level=debug option to the agent and collector (or all-in-one, in your case) to see when these components receive a span from a client.