示例#1
0
 internal TracerDecoration(
     OnSpanLog onSpanLog,
     OnSpanSetTag onSpanSetTag,
     OnSpanFinished onSpanFinished,
     OnSpanStarted onSpanStarted,
     OnSpanActivated onSpanActivated,
     OnSpanStartedWithFinishCallback onSpanStartedWithFinishCallback)
 {
     this.onSpanLog       = onSpanLog;
     this.onSpanSetTag    = onSpanSetTag;
     this.onSpanFinished  = onSpanFinished;
     this.onSpanStarted   = onSpanStarted;
     this.onSpanActivated = onSpanActivated;
     this.onSpanStartedWithFinishCallback = onSpanStartedWithFinishCallback;
 }
示例#2
0
        public ColoredConsoleTracerDecoration(
            ColorChooser colorChooser,
            LogSerializer logSerializer,
            TextFormatter textFormatter,
            SetTagSerializer setTagSerializer,
            bool outputDurationOnFinished)
        {
            this.colorChooser             = colorChooser;
            this.logSerializer            = logSerializer;
            this.textFormatter            = textFormatter;
            this.setTagSerializer         = setTagSerializer;
            this.outputDurationOnFinished = outputDurationOnFinished;

            if (this.outputDurationOnFinished)
            {
                onSpanStarted = (span, operationName) => { span.SetBaggageItem(startTimestampBaggageKey, DateTimeOffset.UtcNow.Ticks.ToString()); };
            }
        }
示例#3
0
 public TracerDecoratorBuilder OnSpanStarted(OnSpanStarted onSpanStarted)
 {
     _onSpanStarteds.Add(onSpanStarted);
     return(this);
 }