public ClientTracingMessageInspector(
     string remoteServiceName,
     ISampler sampler,
     IDispatcher dispatcher,
     ISpanContextAccessor spanContextAccessor)
 {
     _remoteServiceName   = remoteServiceName;
     _sampler             = sampler;
     _dispatcher          = dispatcher;
     _spanContextAccessor = spanContextAccessor;
     _spanContextInjector = new HttpRequestMessagePropertyB3SpanContextInjector();
 }
예제 #2
0
 /// <summary>
 /// Construct a new <see cref="TracingHandler"/> with an inner handler.
 /// </summary>
 /// <param name="spanContextAccessor">
 /// A <see cref="ISpanContextAccessor"/> used to access 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>
 /// <param name="remoteEndpointName">
 /// The name of the receiver.
 /// </param>
 public TracingHandler(
     ISpanContextAccessor spanContextAccessor,
     IDispatcher dispatcher,
     ISampler sampler,
     string remoteEndpointName)
 {
     _remoteEndpointName  = remoteEndpointName ?? throw new ArgumentNullException(nameof(remoteEndpointName));
     _spanContextAccessor = spanContextAccessor ?? throw new ArgumentNullException(nameof(spanContextAccessor));
     _dispatcher          = dispatcher ?? throw new ArgumentNullException(nameof(dispatcher));
     _sampler             = sampler ?? throw new ArgumentNullException(nameof(sampler));
     _spanContextInjector = new HttpRequestMessageB3SpanContextInjector();
 }