/// <summary> /// Enables the incoming requests automatic data collection. /// </summary> /// <param name="builder">Trace builder to use.</param> /// <param name="configure">Configuration options.</param> /// <returns>The instance of <see cref="TracerBuilder"/> to chain the calls.</returns> public static TracerBuilder AddRequestAdapter(this TracerBuilder builder, Action <AspNetCoreAdapterOptions> configure) { if (builder == null) { throw new ArgumentNullException(nameof(builder)); } if (configure == null) { throw new ArgumentNullException(nameof(configure)); } var options = new AspNetCoreAdapterOptions(); configure(options); return(builder.AddAdapter(t => new AspNetCoreAdapter(t, options))); }
public HttpInListener(string name, Tracer tracer, AspNetCoreAdapterOptions options) : base(name, tracer) { this.hostingSupportsW3C = typeof(HttpRequest).Assembly.GetName().Version.Major >= 3; this.options = options ?? throw new ArgumentNullException(nameof(options)); }