Ejemplo n.º 1
0
 public void Init(TracingOptions options)
 {
     Options = options;
     if (Options.Enabled)
     {
         var logger = new MetricsLogger();
         TraceManager.SamplingRate = Options.Rate;
         TraceManager.RegisterTracer(new ZipkinTracer(new HttpZipkinSender(Options.TraceEndpoint, "application/json"), new JSONSpanSerializer(), new Statistics()));
         TraceManager.Start(logger);
     }
     LogManager.Configuration.AddTarget(new ZipkinLogTarget());
     LogManager.Configuration.AddRule(LogLevel.Warn, LogLevel.Error, nameof(ZipkinLogTarget));
     LogManager.ReconfigExistingLoggers();
 }
Ejemplo n.º 2
0
 public TracingInitializer(IOptions <TracingOptions> options, ILoggerFactory loggerFactory)
 {
     _options       = options.Value;
     _loggerFactory = loggerFactory;
 }