@NewSpan does not generate a new span Id for methods using Mono.subscriberContext
See original GitHub issueI 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:
- Created 5 years ago
- Comments:8 (5 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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.
Try with the latest
2.1.0
snapshots