Question - Creating custom spans in functions
See original GitHub issueI have just started to explore distributed tracing and have a question regarding this.
I want to create a Span inside the parseDonutInfo()
to trace the time taken to complete the function call.
https://github.com/opentracing-contrib/java-opentracing-walkthrough/blob/master/microdonuts/src/main/java/com/otsample/api/ApiContextHandler.java#L85
In order to do that, I create a span -
try (Span parseDonutsInfoSpan =
GlobalTracer.get().buildSpan("parseDonutsInfo_span")start()) {}
However, this span doesn’t get included along with the parent Span. It is present as a separate trace in Zipkin UI. How do I ensure that doPost function is the parentSpan of parseDonutsInfo().
Thanks, Let me know if you need any more details.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Two Quick Ways to Create Spans with Kamon Telemetry
Learn how to create Spans programmatically using Kamon Telemetry's helper functions and annotations.
Read more >adding custom data to the spring cloud spans - Stack Overflow
I would like to add a custom id that will be propagated from the initial incoming span (at zuul entry) on through all...
Read more >Creating custom traces with the OpenTelemetry SDK for Java
This video shows how to use the OpenTelemetry SDK for Java to instrument a microservice to produce custom spans. It shows the difference ......
Read more >Custom spans | APM Node.js Agent Reference [3.x] - Elastic
This is an example of how to use custom spans. For general information about the Elastic APM Node.js Span API, see the Span...
Read more >Spancat: a new approach for span labeling - Explosion AI
The suggester is a custom function that extracts possible span ... ner and spancat led to vastly different approaches to the same problem....
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
AFAIU since the parent span was put as an attribute on the request in doPost (just before the call to parseDonutsInfo), you could just do this:
Thanks for the comment @bhs ! It looks like https://github.com/opentracing-contrib/java-opentracing-walkthrough/pull/3 is using activeSpan(). I’ll also try it out from my end.