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.

@NewSpan does not generate a new span Id for methods using Mono.subscriberContext

See original GitHub issue

I am using:

  • Finchley.RELEASE release train
  • Spring boot 2.0.3

If I use Mono.subscriberContext() in a method and annotate the method with @NewSpan(name="myMethod"), no new span ID is generated for that method.

Reference Repo: https://github.com/nnanda2016/springboot-sleuth-issue

The method com.demo.springboot.sleuth.UserApiHandler#getById2 is the buggy one I am talking about. No new span Id is generated if I invoke this method (URL to invoke this: curl -v http://localhost:5002/users/ids/U1).

If I remove Mono.subscriberContext(), everything is working fine as expected. Example method in this sample app is com.demo.springboot.sleuth.UserApiHandler#getById (URL to invoke this: curl -v http://localhost:5002/users/U1).

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kptfhcommented, Aug 10, 2018

@marcingrzejszczak Investigating this issue found that there is a bug in my recent pull request (didn’t set new span in trace context). Will add tests and fix soon.

0reactions
marcingrzejszczakcommented, Aug 14, 2018

Try with the latest 2.1.0 snapshots

Read more comments on GitHub >

github_iconTop Results From Across the Web

spring-cloud/spring-cloud-sleuth - Gitter
I am using spring cloud sleuth with otel dependencies to create traces ans span. I was able to see those traces in zipkin...
Read more >
How do I access the current span and trace ids in a Spring ...
To access the current span in a Reactor flow in Spring, use the Span or TraceContext found in the Subscriber Context. Mono.
Read more >
sleuth span 的获取 - CSDN
如果采用newSpan注解,那么这里需要通过之前的在配置类中生成的tracer的getCurrentSpan()方法获取当前的span。 具体的实现在SpanContextHolder的getCurrentSpan()方法中。
Read more >
brave.Tracer java examples - Code Suche
currentSpan () == null) { throw new IllegalStateException("Current Span is supposed to have a value!"); } return tracer.currentSpan().context().spanId() ...
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