private static SpanAnnotations ConstructInitialAnnotations([NotNull] TracerSettings settings) { var annotations = SpanAnnotations.Empty .Set(WellKnownAnnotations.Common.Host, settings.Host ?? EnvironmentInfo.Host) .Set(WellKnownAnnotations.Common.Application, settings.Application ?? EnvironmentInfo.Application); if (settings.Environment != null) { annotations = annotations.Set(WellKnownAnnotations.Common.Environment, settings.Environment); } return(annotations); }
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 Tracer(TracerSettings settings) { this.settings = settings ?? throw new ArgumentNullException(nameof(settings)); }