public void Dispose() { if (metadata.EndTimestamp == DateTimeOffset.MinValue) { metadata = metadata.SetEndTimestamp(metadata.BeginTimestamp + watch.Elapsed); } using (contextScope) { settings.Sender.Send(CurrentSpan); } }
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(); }
public Span(SpanMetadata metadata, ImmutableArrayDictionary <string, object> annotations) { this.metadata = metadata; this.annotations = annotations; }
public void SetEndTimestamp(DateTimeOffset?timestamp) { metadata = metadata.SetEndTimestamp(timestamp); }
public void SetBeginTimestamp(DateTimeOffset timestamp) { metadata = metadata.SetBeginTimestamp(timestamp); }