question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using Spring Cloud Sleuth with OpenZipkin. GUI not showing all spans

See original GitHub issue

I 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.

openzipkinimage

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:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Mrc0113commented, Oct 5, 2021

okay I can verify that this issue is now resolved when using Spring Boot v2.4.10 and Spring Cloud v2020.0.4. Thanks!

1reaction
jonatan-ivanovcommented, May 10, 2021

@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 Function is called. My guess is the context is not propagated (as I mentioned above, this might be an unsupported scenario).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Spring Cloud Sleuth with OpenZipkin. GUI not showing ...
In the OpenZipkin GUI I expected to see the trace showing Spans for both the "UppercaseApp" and the "ReverseApp" however it just shows...
Read more >
Spring Cloud Sleuth Reference Documentation
Spring Cloud Sleuth Core in its api module contains all necessary interfaces ... interface to retrieve the URL Pattern for spans that should...
Read more >
Zipkin server unable to consume span events from kafka ...
Services are able to publish span messages to kafka using spring cloud sleuth but zipkin server is not able to consume the messages...
Read more >
Distributed Tracing with Spring Cloud Sleuth And Zipkin
Trace Id is used to trace an incoming request and track it across all the composing services to satisfy a request. Span Id...
Read more >
spring-cloud/spring-cloud-sleuth - Gitter
My traces are not showing up in the UI ... to Google Cloud StackDriver and I am not using the Zipkin server at...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found