コード例 #1
0
        private SpanId GetNewSpanId()
        {
            Span parentSpan = SpanAndEndpoint.State.CurrentLocalSpan;

            if (parentSpan == null)
            {
                ServerSpan serverSpan = SpanAndEndpoint.State.CurrentServerSpan;
                if (serverSpan != null)
                {
                    parentSpan = serverSpan.Span;
                }
            }
            long newSpanId = Util.NextLong();

            if (parentSpan == null)
            {
                return(new SpanId(newSpanId, newSpanId, null));
            }

            return(new SpanId(parentSpan.Trace_id, newSpanId, parentSpan.Id));
        }
コード例 #2
0
 /**
  * Binds given span to current thread. This should typically be called when code is invoked in new thread to bind the
  * span from the thread in which we received the request to the new execution thread.
  *
  * @param span Span to bind to current execution thread. Should not be <code>null</code>.
  */
 public void SetCurrentSpan(ServerSpan span)
 {
     state.CurrentServerSpan = span;
 }
コード例 #3
0
 public static void SetCurrentServerSpan(ServerSpan span)
 {
     zipkin.ServerSpanThreadBinder().SetCurrentSpan(span);
 }