I am using spring boot version 3.3.1 in my spring boot project with jaeger for distributed tracing (version 3.3.1 which latest recommended version) and my java version is 17.
I have added dependencies as follows:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.0.0</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<dependency>
<groupId>io.opentracing.contrib</groupId>
<artifactId>opentracing-spring-jaeger-cloud-starter</artifactId>
<version>3.3.1</version>
</dependency>
This my configuration file:
package com.example.jaegerclient.config;
import io.jaegertracing.internal.JaegerTracer;
import io.jaegertracing.internal.samplers.ConstSampler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.function.client.WebClient;
@Configuration
public class JaegerConfig {
@Bean
public WebClient webClient() {
return WebClient.create();
}
@Bean
public JaegerTracer jaegerTracer() {
return new io.jaegertracing.Configuration("jaeger-client")
.withSampler(new io.jaegertracing.Configuration.SamplerConfiguration().withType(ConstSampler.TYPE)
.withParam(1))
.withReporter(new io.jaegertracing.Configuration.ReporterConfiguration().withLogSpans(true))
.getTracer();
}
}
Upon starting application I can see in logs that jaeger has configured
2022-12-20T12:22:51.543+05:30 INFO 22028 --- [ main] io.jaegertracing.Configuration : Initialized tracer=JaegerTracer(version=Java-1.1.0, serviceName=jaeger-client, reporter=CompositeReporter(reporters=[RemoteReporter(sender=UdpSender(), closeEnqueueTimeout=1000), LoggingReporter(logger=Logger[io.jaegertracing.internal.reporters.LoggingReporter])]), sampler=ConstSampler(decision=true, tags={sampler.type=const, sampler.param=true}), tags={hostname=xyz, jaeger.version=Java-1.1.0, ip=192.xxx.xx.xx}, zipkinSharedRpcSpan=false, expandExceptionLogs=false, useTraceId128Bit=false)
But I am not able see the service in jaeger UI or any traces even after I hit the request.
When I use spring boot lower than 3.0.0 like 2.7.7, I am able to see the service and traces in jaeger UI.
I just want to know that jaeger is not compatible with spring boot 3.0.0 or I am doing something wrong.
Thanks in advance.
yes, currently it is not supporting, I also tried. with no change, it work on the 2.7.7 version