コード例 #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 <AspNetCollectorOptions> configure)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

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

            var options = new AspNetCollectorOptions();

            configure(options);

            return(builder.AddCollector(t => new AspNetCollector(t, options)));
        }
コード例 #2
0
 public HttpInListener(string name, Tracer tracer, AspNetCollectorOptions options)
     : base(name, tracer)
 {
     this.options = options ?? throw new ArgumentNullException(nameof(options));
 }