<div dir="ltr">Hello John,<div><br></div><div>this might also help: <a href="https://github.com/opentracing/specification/blob/master/specification.md#the-opentracing-data-model">https://github.com/opentracing/specification/blob/master/specification.md#the-opentracing-data-model</a> and also following subsection <a href="https://github.com/opentracing/specification/blob/master/specification.md#references-between-spans">https://github.com/opentracing/specification/blob/master/specification.md#references-between-spans</a>. </div><div><br></div><div><br></div><div>Pavol</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 10, 2017 at 10:45 AM, Gary Brown <span dir="ltr">&lt;<a href="mailto:gbrown@redhat.com" target="_blank">gbrown@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">For a concrete example, we have a vertx-opentracing application:<br>
<br>
<a href="https://github.com/hawkular/hawkular-apm/blob/master/examples/vertx-opentracing/order-manager/src/main/java/org/hawkular/apm/examples/vertx/opentracing/ordermanager/PlaceOrderHandler.java#L52" rel="noreferrer" target="_blank">https://github.com/hawkular/<wbr>hawkular-apm/blob/master/<wbr>examples/vertx-opentracing/<wbr>order-manager/src/main/java/<wbr>org/hawkular/apm/examples/<wbr>vertx/opentracing/<wbr>ordermanager/<wbr>PlaceOrderHandler.java#L52</a><br>
<br>
This shows where the top level span is started within the order manager service. This span is propagated through various handlers until it is finally finished here:<br>
<br>
<a href="https://github.com/hawkular/hawkular-apm/blob/master/examples/vertx-opentracing/order-manager/src/main/java/org/hawkular/apm/examples/vertx/opentracing/ordermanager/PlaceOrderHandler.java#L126" rel="noreferrer" target="_blank">https://github.com/hawkular/<wbr>hawkular-apm/blob/master/<wbr>examples/vertx-opentracing/<wbr>order-manager/src/main/java/<wbr>org/hawkular/apm/examples/<wbr>vertx/opentracing/<wbr>ordermanager/<wbr>PlaceOrderHandler.java#L126</a><br>
<div class="HOEnZb"><div class="h5"><br>
Regards<br>
Gary<br>
<br>
----- Original Message -----<br>
&gt; Hi John<br>
&gt;<br>
&gt; If I put things in OpenTracing terms, each unit of work we want to measure is<br>
&gt; a Span, where work performed in the scope of one Span, is created as a child<br>
&gt; of that Span - so building up a tree structure. So this is how units of<br>
&gt; work, whether sync or async, get represented.<br>
&gt;<br>
&gt; So the issue is, how we identify the start and end of a Span, when they are<br>
&gt; not necessarily occurring within the same thread. And secondly, when a child<br>
&gt; activity is spawned, that is not in the same thread as its parent, how that<br>
&gt; child Span becomes associated with its parent.<br>
&gt;<br>
&gt; The piece of code you reference is part of the original java agent, and it<br>
&gt; relies on ThreadLocal as a way to track activity within threads - but to<br>
&gt; support async behaviour, the agent also enables the trace sessions/context<br>
&gt; to be propagated across threads, using context relevant ids.<br>
&gt;<br>
&gt; If explicitly instrumenting code with the OpenTracing API, async behaviour<br>
&gt; can be monitored by simply passing around the Span objects.<br>
&gt;<br>
&gt; Let me know if you need further information in any particular area.<br>
&gt;<br>
&gt; Regards<br>
&gt; Gary<br>
&gt;<br>
&gt; ----- Original Message -----<br>
&gt; &gt; I am reading through some of the Hawkular APM code and have been looking at<br>
&gt; &gt; how trace fragments get created and written on the client side. One of the<br>
&gt; &gt; classes I am reviewing is FragmentBuilder.java. Its javadocs state that the<br>
&gt; &gt; sequence of events within a thread of execution should be in sequence. It<br>
&gt; &gt; made me wonder whether it is possible to trace async operations. I found<br>
&gt; &gt; <a href="https://issues.jboss.org/browse/HWKAPM-77" rel="noreferrer" target="_blank">https://issues.jboss.org/<wbr>browse/HWKAPM-77</a><br>
&gt; &gt; &lt;<a href="https://issues.jboss.org/browse/HWKAPM-77" rel="noreferrer" target="_blank">https://issues.jboss.org/<wbr>browse/HWKAPM-77</a>&gt; which apparently improves<br>
&gt; &gt; support for async execution.<br>
&gt; &gt;<br>
&gt; &gt; Gary, can you or anyone else familiar how things work, give a brief<br>
&gt; &gt; explanation of how things work async flows? Most everything in<br>
&gt; &gt; hawkular-metrics is async and reactive. That makes debugging difficult at<br>
&gt; &gt; times where you have to rely primarily on logging. I am wondering if<br>
&gt; &gt; Hawkular APM would be a good tool for these types of situations.<br>
&gt; &gt;<br>
&gt; &gt; - John<br>
&gt;<br>
______________________________<wbr>_________________<br>
hawkular-dev mailing list<br>
<a href="mailto:hawkular-dev@lists.jboss.org">hawkular-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/hawkular-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/hawkular-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><font color="#999999">Pavol Loffay<br>Cell: +421948286055</font></div><div dir="ltr"><font color="#999999">Red Hat<br>Purkyňova 111 </font><span style="color:rgb(153,153,153);font-size:12.8px">TPB-B</span><font color="#999999"><br>612 45 Brno</font></div></div></div></div>
</div>