Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trace id is not Propagating to called service #1368

Open
RoopaRJ opened this issue Apr 18, 2023 · 0 comments
Open

Trace id is not Propagating to called service #1368

RoopaRJ opened this issue Apr 18, 2023 · 0 comments
Labels

Comments

@RoopaRJ
Copy link

RoopaRJ commented Apr 18, 2023

when i am calling another microservice using resttemplate it is working fine but when i tried with httpclient/webclient trace id is not propagating to the next service.
example: in logs for service a it is showing traceid1, in service b it is showing traceid2 ideally we should get same trace id's in for the entire journey of a single request

below are the dependencies used in my springboot3 application for distributed tracing:
implementation platform('io.micrometer:micrometer-tracing-bom:latest.release')
implementation 'io.micrometer:micrometer-tracing-bridge-brave'
implementation 'io.zipkin.reporter2:zipkin-reporter-brave'
implementation 'io.zipkin.reporter2:zipkin-sender-urlconnection'
implementation("org.springframework.boot:spring-boot-starter-webflux:3.0.5")

in application.yml i have added:
zipkin:
tracing:
endpoint: http://localhost:9411/api/v2/spans

i am autowiring the Tracer to create spans like below:
tracer.spanBuilder().name("randomSpan").start()

this is how i am calling another service using webclient:
webClient.post()
.uri(URI.create("url"))
.contentType(MediaType.APPLICATION_JSON)
.header("X-B3-TraceId", tracer.currentTraceContext().context().traceId())
.body(BodyInserters.fromValue(body))
.retrieve()
.bodyToMono(java class)
.block()

@RoopaRJ RoopaRJ added the bug label Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant