Exemple #1
0
        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);
        }
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 Tracer(TracerSettings settings)
 {
     this.settings = settings ?? throw new ArgumentNullException(nameof(settings));
 }