コード例 #1
0
 public ISpanBuilder AsChildOf(ISpanContext parent)
 {
     lock (_lock)
     {
         _parent = (OpenTracingSpanContext)parent;
         return(this);
     }
 }
コード例 #2
0
        public void Inject(OpenTracingSpanContext spanContext, object carrier)
        {
            ITextMap map = carrier as ITextMap;

            if (map == null)
            {
                throw new NotSupportedException("Carrier should have type ITextMap");
            }

            map.Set(HttpHeaderNames.HttpHeaderParentId, spanContext.Context.SpanId.ToString());
            map.Set(HttpHeaderNames.HttpHeaderTraceId, spanContext.Context.TraceId.ToString());
        }
コード例 #3
0
        public ISpanBuilder AddReference(string referenceType, ISpanContext referencedContext)
        {
            lock (_lock)
            {
                if (referenceType == References.ChildOf)
                {
                    _parent = (OpenTracingSpanContext)referencedContext;
                    return(this);
                }
            }

            _log.Debug("ISpanBuilder.AddReference is not implemented for other references than ChildOf by Datadog.Trace");
            return(this);
        }
コード例 #4
0
 internal OpenTracingSpan(Span span)
 {
     Span    = span;
     Context = new OpenTracingSpanContext(Span.Context);
 }