예제 #1
0
 public DispatchTracingMessageInspector(
     string localEndpointName,
     ISampler sampler,
     IDispatcher dispatcher,
     ISpanContextAccessor spanContextAccessor)
 {
     _localEndpointName    = localEndpointName;
     _sampler              = sampler;
     _dispatcher           = dispatcher;
     _spanContextAccessor  = spanContextAccessor;
     _spanContextExtractor = new IncomingWebRequestB3SpanContextExtractor();
 }
 /// <summary>
 /// Construct a new <see cref="TracingMiddleware"/>.
 /// </summary>
 /// <param name="localEndpointName">
 /// The endpoint name describes the host recording the span.
 /// </param>
 /// <param name="spanContextAccessor">
 /// A <see cref="ISpanContextAccessor"/> used to access the parent span context.
 /// </param>
 /// <param name="dispatcher">
 /// A <see cref="IDispatcher"/> used to dispatch completed spans to reporters.
 /// </param>
 /// <param name="sampler">
 /// A <see cref="ISampler"/> used to make sampling decisions.
 /// </param>
 public TracingMiddleware(
     string localEndpointName,
     ISpanContextAccessor spanContextAccessor,
     IDispatcher dispatcher,
     ISampler sampler)
 {
     _localEndpointName    = localEndpointName;
     _spanContextAccessor  = spanContextAccessor ?? throw new ArgumentNullException(nameof(spanContextAccessor));
     _dispatcher           = dispatcher ?? throw new ArgumentNullException(nameof(dispatcher));
     _sampler              = sampler ?? throw new ArgumentNullException(nameof(sampler));
     _spanContextExtractor = new HttpRequestB3SpanContextExtractor();
 }