// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); // Регистрируем middleware services.AddOpenTracing(); // Добавляем LightStep Tracer. services.AddSingleton <ITracer>(serviceProvider => { var tracerOptions = new LightStep.Options(); var tracer = new Tracer(tracerOptions); GlobalTracer.Register(tracer); return(tracer); }); }
public static IServiceCollection AddLightStep(this IServiceCollection services) { if (services == null) { throw new ArgumentNullException(nameof(services)); } services.AddSingleton <ITracer>(serviceProvider => { string serviceName = Assembly.GetEntryAssembly().GetName().Name; ILoggerFactory loggerFactory = serviceProvider.GetRequiredService <ILoggerFactory>(); var options = new LightStep.Options(_lightStepProjectKey, new SatelliteOptions("collector.lightstep.com")); ITracer tracer = new LightStep.Tracer(options); GlobalTracer.Register(tracer); return(tracer); }); return(services); }
/// <inheritdoc /> public Tracer(Options options, ISpanRecorder spanRecorder, IReportTranslator translator, ILightStepHttpClient client) : this( new AsyncLocalScopeManager(), Propagators.TextMap, options, spanRecorder, client, translator) { }
/// <inheritdoc /> public Tracer(Options options, IPropagator propagator, ILightStepHttpClient client) : this( new AsyncLocalScopeManager(), propagator, options, new LightStepSpanRecorder(), client) { }
/// <inheritdoc /> public Tracer(Options options, ISpanRecorder spanRecorder, IPropagator propagator) : this( new AsyncLocalScopeManager(), propagator, options, spanRecorder, null) { }
/// <inheritdoc /> public Tracer(Options options, IScopeManager scopeManager) : this(scopeManager, Propagators.TextMap, options, new LightStepSpanRecorder(), null) { }
/// <inheritdoc /> public Tracer(Options options, ISpanRecorder spanRecorder) : this(new AsyncLocalScopeManager(), Propagators.TextMap, options, spanRecorder, null) { }
/// <inheritdoc /> public Tracer(Options options) : this(new AsyncLocalScopeManager(), Propagators.TextMap, options, new LightStepSpanRecorder(), null) { }