opentracing-contrib / java-spring-jaeger

Apache License 2.0
256 stars 95 forks source link

spring boot jaeger won't trace webClient request #149

Open emoleumassi opened 1 year ago

emoleumassi commented 1 year ago

I have a Spring boot application and i want to trace the webClient request with jaeger:

implementation "io.micrometer:micrometer-registry-prometheus:1.10.3"
implementation "org.springframework.boot:spring-boot-starter-web:2.6.6"
implementation "org.springframework.boot:spring-boot-starter-webflux:2.6.6"
implementation 'io.opentracing.contrib:opentracing-spring-jaeger-web-starter:3.3.1'
implementation "io.opentracing.contrib:opentracing-jdbc:0.2.15"

My application.yml:

server:
  port: 4502
spring:
   application:
    name: myServiceName
  datasource:
    url: jdbc:tracing:sqlserver:xxxx
    username: sssr
    password: blabla
    driver-class-name: io.opentracing.contrib.jdbc.TracingDriver 

opentracing:
  jaeger:
    enabled: true
    service-name: myServiceName
    log-spans: true
    udp-sender:
      port: 31683
      host: a.b.asd.wq
    http-sender:
      url: http://a.b.asd.wq:31268/api/traces

my webClient request:

String response = webClient.get()
                                    .uri(url)
                                    .retrieve()
                                    .bodyToMono(String.class)
                                    .block();

i send a request to http://127.0.0.1:4502/ and i got some spans reported

2023.02.22 10:02:54.350 [http-nio-4502-exec-1] INFO  i.j.i.reporters.LoggingReporter:43 - Span reported: 7d0aef60d1f97f02:7d0aef60d1f97f02:0:1 - GET

The Jaeger UI on the host can the webClient request not reported.