Using Spring Cloud Sleuth with OpenZipkin. GUI not showing all spans
See original GitHub issueI am trying to prototype getting Spring Cloud Sleuth working with Spring Cloud Stream microservices and sending tracing info to OpenZipkin. It seems to be working however for some reason I’m not seeing what I’d expect in the OpenZipkin GUI.
I uploaded my code here and it should only take 5-10 minutes to get completely running. Including the broker + openzipkin. https://github.com/Mrc0113/spring-cloud-stream-sleuth
Versions:
- I’ve tried the latest release versions (2020.0.2) and the latest snapshot versions (2020.0.3-SNAPSHOT) of spring cloud
Expected Flow: Try-Me Publisher -> uppercase-in-0 topic on broker -> Uppercase Microservice (Trace starts here) -> uppercase-out-0 topic -> Reverse Microservice (Tracing still enabled here…same traceid, different span id) -> reverse-out-0 topic -> Try Me Consumer if you want.
In the OpenZipkin GUI I expected to see the trace showing Spans for both the “UppercaseApp” and the “ReverseApp” however it just shows the spans related to the “UppercaseApp”. Shouldn’t it show the “ReverseApp” as well?
When you download the JSON from OpenZipkin it shows 6 spans including both microservices so I’m not sure if I’m doing something wrong or if this is just a bug in OpenZipkin’s GUI.
Downloaded JSON:
[
{
"traceId": "ff03e5a7078c7300",
"parentId": "ff03e5a7078c7300",
"id": "0e954000ac123168",
"kind": "CONSUMER",
"timestamp": 1617974110519267,
"duration": 17,
"localEndpoint": {
"serviceName": "uppercaseapp",
"ipv4": "192.168.1.25"
},
"remoteEndpoint": {
"serviceName": "broker"
},
"tags": {
"channel": "uppercase"
}
},
{
"traceId": "ff03e5a7078c7300",
"parentId": "0e954000ac123168",
"id": "7cc8f2fe19e3e429",
"name": "handle",
"timestamp": 1617974110527406,
"duration": 3800,
"localEndpoint": {
"serviceName": "uppercaseapp",
"ipv4": "192.168.1.25"
}
},
{
"traceId": "ff03e5a7078c7300",
"parentId": "0e954000ac123168",
"id": "b136a2d5e017b1c6",
"kind": "PRODUCER",
"name": "send",
"timestamp": 1617974110532062,
"duration": 1802,
"localEndpoint": {
"serviceName": "uppercaseapp",
"ipv4": "192.168.1.25"
},
"remoteEndpoint": {
"serviceName": "broker"
},
"tags": {
"channel": "uppercase"
}
},
{
"traceId": "ff03e5a7078c7300",
"parentId": "8432f0d20ee1c58a",
"id": "eb4d8e0d2265ccf9",
"kind": "CONSUMER",
"timestamp": 1617974110633526,
"duration": 23,
"localEndpoint": {
"serviceName": "reverseapp",
"ipv4": "192.168.1.25"
},
"remoteEndpoint": {
"serviceName": "broker"
},
"tags": {
"channel": "uppercase-out-0"
}
},
{
"traceId": "ff03e5a7078c7300",
"parentId": "eb4d8e0d2265ccf9",
"id": "5d342c6ff6cda3f9",
"name": "handle",
"timestamp": 1617974110643065,
"duration": 4683,
"localEndpoint": {
"serviceName": "reverseapp",
"ipv4": "192.168.1.25"
}
},
{
"traceId": "ff03e5a7078c7300",
"parentId": "eb4d8e0d2265ccf9",
"id": "9d467b04bf9a832e",
"kind": "PRODUCER",
"name": "send",
"timestamp": 1617974110649193,
"duration": 1998,
"localEndpoint": {
"serviceName": "reverseapp",
"ipv4": "192.168.1.25"
},
"remoteEndpoint": {
"serviceName": "broker"
},
"tags": {
"channel": "uppercase-out-0"
}
}
]
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)


Top Related StackOverflow Question
okay I can verify that this issue is now resolved when using Spring Boot v2.4.10 and Spring Cloud v2020.0.4. Thanks!
@Mrc0113 This is my understanding. The parentId of the span in the consumer should be the id of the span in the producer. I need to debug this (thank you for the sample project): we need to check what happens between the message is received and your
Functionis called. My guess is the context is not propagated (as I mentioned above, this might be an unsupported scenario).