Exemplo n.º 1
0
        /// <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 AddRequestCollector(this TracerBuilder builder, Action <AspNetCoreCollectorOptions> configure)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            if (configure == null)
            {
                throw new ArgumentNullException(nameof(configure));
            }

            var options = new AspNetCoreCollectorOptions();

            configure(options);

            return(builder.AddCollector(t => new AspNetCoreCollector(t, options)));
        }
Exemplo n.º 2
0
 public HttpInListener(string name, Tracer tracer, AspNetCoreCollectorOptions options)
     : base(name, tracer)
 {
     this.hostingSupportsW3C = typeof(HttpRequest).Assembly.GetName().Version.Major >= 3;
     this.options            = options ?? throw new ArgumentNullException(nameof(options));
 }