You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by achatterjee104 January 20, 2023
Expectation
Scenario 1:
There are 2 REST services - service-A and service-B
A request comes to service-A and its OpenTracingServerFilter creates a new span, say [trace-id=1, span-id=1]
service-A invokes service-B, waits for its response and then returns the consolidated result
service-B will get the request with [trace-id=1, span-id=1] and it should created its new span [trace-id=1, span-id=2] (since trace-id is already present)
At the end, there will be 2 spans (span-id=1 & span-id=2) as child of trace-id=1
Scenario 2:
There is a REST service with 2 endpoints - /books & /authors
A request comes to /books and its OpenTracingServerFilter creates a new span, say [trace-id=1, span-id=1]
/books endpoint internally invokes /authors endpoint (via a REST call), waits for its response and then returns the consolidated result
during /authors endpoint call, the OpenTracingServerFilter will get the request with [trace-id=1, span-id=1] and it should created its new span [trace-id=1, span-id=2] (since trace-id is already present)
At the end, there will be 2 spans (span-id=1 & span-id=2) as child of trace-id=1
Ref: This guide says "Whenever a Micronaut server receives a request, it creates a new span"
From Source Code
From OpenTracingServerFilter,
Tracer.SpanBuilder spanBuilder = continued ? null : newSpan(request, initSpanContext(request))
it seems to be creating new span everytime, irrespective of presence of existing trace-id.
The text was updated successfully, but these errors were encountered:
Hi @achatterjee104 can you give better explanation. What is now happening, and what should happened? My understanding that trace-id identifies whole trace with all spans on it. I don't see a problem with creating a new span.
Hi @n0tl3ss I have not tested scenario 1, but in scenario 2, I could see 4th step is not being followed - it is creating new trace-id for /authors request instead of creating new span under the existing trace-id that was created for /books request.
I also could not see any place where this trace-id is actually created in the code. Can you please point me to that place, it will help me to track the flow more closely.
Discussed in #230
Originally posted by achatterjee104 January 20, 2023
Expectation
Scenario 1:
Scenario 2:
Ref: This guide says "Whenever a Micronaut server receives a request, it creates a new span"
From Source Code
From OpenTracingServerFilter,
Tracer.SpanBuilder spanBuilder = continued ? null : newSpan(request, initSpanContext(request))
it seems to be creating new span everytime, irrespective of presence of existing trace-id.
The text was updated successfully, but these errors were encountered: