Reputation: 11
As sleuth project is moved into the Micrometer Tracing project as of SpringBoot 3, having issue with x_b3_traceid when deploying the application to PCF. Before Springboot 3, used to get the same x_b3_traceid in the log and the PCF's GOrouter logs.
But now seeing different x_b3_traceid between application logs and GOrouter logs- 6447d6557ff6934ce613142682e7f6ff (expected) vs 4a947108c123812a06f86bb13c05bab0 (actual)
Sample Logs (application and Gorouter log) -
2023-04-25T09:32:05.556-04:00 [APP/PROC/WEB/2] [OUT] 2023-04-25T13:32:05.555Z INFO [sample-api,**6447d6557ff6934ce613142682e7f6ff**,67ed0eca64b448c1] 15 --- [nio-8080-exec-1] sample.controller.DemoController : Fetching the user info
2023-04-25T09:32:05.561-04:00 [RTR/11] [OUT] sample-api.com - [2023-04-25T13:32:05.542389295Z] "GET /demo HTTP/1.1" 200 0 55 "-" "PostmanRuntime/7.32.2" "127.0.0.1:12345" "127.0.0.1:12345" x_forwarded_for:"127.0.0.1" x_forwarded_proto:"https" vcap_request_id:"a3bae067-9e04-4299-6d50-c6a4256740e6" response_time:0.018694 gorouter_time:0.000253 app_id:"23f0f921-7931-4190-8453-344a595698ed" app_index:"2" instance_id:"3d2bb4f7-3fc3-450c-7853-9305" x_cf_routererror:"-" x_b3_traceid:"**4a947108c123812a06f86bb13c05bab0**" x_b3_spanid:"06f86bb13c05bab0" x_b3_parentspanid:"-" b3:"4a947108c123812a06f86bb13c05bab0-06f86bb13c05bab0"
Dependencies -
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-observation</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-tracing-bridge-brave</artifactId>
</dependency>
<dependency>
<groupId>io.zipkin.reporter2</groupId>
<artifactId>zipkin-reporter-brave</artifactId>
</dependency>
These are the configs I have -
logging.pattern.level=%5p [${spring.application.name:},%X{traceId:-},%X{spanId:-}] #To add trace and span ids to logs
spring.sleuth.propagation.type=w3c,b3 #To have b3 headers. As PCF Zipkin accepts b3 instead of default w3c
Tried different tracers - OpenZipkin Brave and OpenTelemetry. Got the same result and it looks PCF's Gorouter ignoring the b3 traceid in the header and generating its own traceid.
Upvotes: 1
Views: 418