public StatusController( IDispatcher dispatcher, ISampler sampler, ISpanContextAccessor spanContextAccessor) { _dispatcher = dispatcher; _sampler = sampler; _spanContextAccessor = spanContextAccessor; }
static DataService() { var sender = new ZipkinHttpSender("http://localhost:9411"); var reporter = new ZipkinReporter(sender); var reporters = new[] { reporter }; Sampler = new RateSampler(1f); Dispatcher = new AsyncActionBlockDispatcher(reporters); SpanContextAccessor = new SystemWebHttpContextSpanContextAccessor(); }
public EndpointTracingBehavior( string remoteEndpointName, ISampler sampler, IDispatcher dispatcher, ISpanContextAccessor spanContextAccessor) { _remoteEndpointName = remoteEndpointName; _sampler = sampler; _dispatcher = dispatcher; _spanContextAccessor = spanContextAccessor; }
public ValuesController( IHttpClientFactory httpClientFactory, IDispatcher dispatcher, ISampler sampler, ISpanContextAccessor spanContextAccessor) { _httpClientFactory = httpClientFactory; _dispatcher = dispatcher; _sampler = sampler; _spanContextAccessor = spanContextAccessor; }
public ServiceTracingBehavior( string localEndpointName, ISampler sampler, IDispatcher dispatcher, ISpanContextAccessor spanContextAccessor) { _localEndpointName = localEndpointName; _sampler = sampler; _dispatcher = dispatcher; _spanContextAccessor = spanContextAccessor; }
public DispatchTracingMessageInspector( string localEndpointName, ISampler sampler, IDispatcher dispatcher, ISpanContextAccessor spanContextAccessor) { _localEndpointName = localEndpointName; _sampler = sampler; _dispatcher = dispatcher; _spanContextAccessor = spanContextAccessor; _spanContextExtractor = new IncomingWebRequestB3SpanContextExtractor(); }
public ClientTracingMessageInspector( string remoteServiceName, ISampler sampler, IDispatcher dispatcher, ISpanContextAccessor spanContextAccessor) { _remoteServiceName = remoteServiceName; _sampler = sampler; _dispatcher = dispatcher; _spanContextAccessor = spanContextAccessor; _spanContextInjector = new HttpRequestMessagePropertyB3SpanContextInjector(); }
/// <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(); }
/// <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(); }
public void Ctor_NullArgs( ISpanContextAccessor spanContextAccessor, IDispatcher dispatcher, ISampler sampler, string remoteEndpointName) { Assert.Throws <ArgumentNullException>( () => new TracingHandler( spanContextAccessor, dispatcher, sampler, remoteEndpointName)); }