Exemple #1
0
        public void Dispose()
        {
            if (metadata.EndTimestamp == DateTimeOffset.MinValue)
            {
                metadata = metadata.SetEndTimestamp(metadata.BeginTimestamp + watch.Elapsed);
            }

            using (contextScope)
            {
                settings.Sender.Send(CurrentSpan);
            }
        }
Exemple #2
0
        public SpanBuilder(
            [NotNull] TracerSettings settings,
            [NotNull] IDisposable contextScope,
            [NotNull] TraceContext currentContext,
            [CanBeNull] TraceContext parentContext)
        {
            this.settings     = settings ?? throw new ArgumentNullException(nameof(settings));
            this.contextScope = contextScope ?? throw new ArgumentNullException(nameof(contextScope));

            metadata    = ConstructInitialMetadata(currentContext, parentContext);
            annotations = ConstructInitialAnnotations(settings);
            watch       = Stopwatch.StartNew();
        }
Exemple #3
0
 public Span(SpanMetadata metadata, ImmutableArrayDictionary <string, object> annotations)
 {
     this.metadata    = metadata;
     this.annotations = annotations;
 }
Exemple #4
0
 public void SetEndTimestamp(DateTimeOffset?timestamp)
 {
     metadata = metadata.SetEndTimestamp(timestamp);
 }
Exemple #5
0
 public void SetBeginTimestamp(DateTimeOffset timestamp)
 {
     metadata = metadata.SetBeginTimestamp(timestamp);
 }