How to handle un-finished spans

35 views
Skip to first unread message

Sandeep Paliwal

unread,
Jun 5, 2018, 3:31:03 AM6/5/18
to OpenTracing
Hi,

Is there a way to handle cases when spans which were started were not closed for any reason.
Say I started a Span spmething like  this - 
tracer
.buildSpan("myspan")
.startActive(true)

And the finish method is never called on span. Does this get automatically closed when thread ends or it can cause memory leaks?

thanks,
Sandeep

Kevin Grigorenko

unread,
Jun 5, 2018, 2:03:03 PM6/5/18
to Sandeep Paliwal, OpenTracing

Hi Sandeep,

You should use a try-with-resources statement to properly end the span: http://static.javadoc.io/io.opentracing/opentracing-api/0.31.0/io/opentracing/Tracer.html#buildSpan-java.lang.String-

--
Kevin Grigorenko
kevin.gr...@us.ibm.com
IBM WebSphere SWAT


Inactive hide details for Sandeep Paliwal ---06/05/2018 12:31:08 AM---Hi, Is there a way to handle cases when spans which were Sandeep Paliwal ---06/05/2018 12:31:08 AM---Hi, Is there a way to handle cases when spans which were started were not

--
You received this message because you are subscribed to the Google Groups "OpenTracing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opentracing...@googlegroups.com.
To post to this group, send email to opent...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/opentracing/05900b76-8ab6-43bb-ab9c-8b6179d6b976%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Reply all
Reply to author
Forward
0 new messages