Exemple #1
0
        internal Span(ThresholdLoggingTracer tracer, string operationName, ISpanContext parentContext, long startTimestamp, Dictionary <string, object> tags, List <Reference> references)
        {
            Tracer          = tracer;
            OperationName   = operationName;
            _startTimestamp = startTimestamp;
            Tags            = tags ?? new Dictionary <string, object>();
            References      = references ?? new List <Reference>();

            if (parentContext == null)
            {
                // new root span
                ParentId = null;
                Context  = new SpanContext(NextTraceId(), NextSpanId(), null);
            }
            else
            {
                // sub-span
                ParentId = parentContext.SpanId;
                Context  = new SpanContext(
                    parentContext.TraceId,
                    NextSpanId(),
                    References.SelectMany(x => x.Context.GetBaggageItems())
                    );
            }
        }
 public SpanBuilder(ThresholdLoggingTracer tracer, string operationName)
 {
     _tracer        = tracer;
     _operationName = operationName;
 }