Beispiel #1
0
        /// <summary>
        /// Enables the outgoing requests automatic data collection.
        /// </summary>
        /// <param name="builder">Trace builder to use.</param>
        /// <param name="configureHttpCollectorOptions">Http configuration options.</param>
        /// <param name="configureSqlCollectorOptions">Sql configuration options.</param>
        /// <returns>The instance of <see cref="TracerBuilder"/> to chain the calls.</returns>
        public static TracerBuilder AddDependencyCollector(
            this TracerBuilder builder,
            Action <HttpClientCollectorOptions> configureHttpCollectorOptions = null,
            Action <SqlClientCollectorOptions> configureSqlCollectorOptions   = null)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            var httpOptions = new HttpClientCollectorOptions();

            configureHttpCollectorOptions?.Invoke(httpOptions);

            var sqlOptions = new SqlClientCollectorOptions();

            configureSqlCollectorOptions?.Invoke(sqlOptions);

            return(builder
                   .AddCollector((t) => new AzureClientsCollector(t))
                   .AddCollector((t) => new AzurePipelineCollector(t))
                   .AddCollector((t) => new HttpClientCollector(t, httpOptions))
                   .AddCollector((t) => new HttpWebRequestCollector(t, httpOptions))
                   .AddCollector((t) => new SqlClientCollector(t, sqlOptions)));
        }
Beispiel #2
0
        /// <summary>
        /// Enables the incoming requests automatic data collection.
        /// </summary>
        /// <param name="builder">Trace builder to use.</param>
        /// <returns>The instance of <see cref="TracerBuilder"/> to chain the calls.</returns>
        public static TracerBuilder AddRequestCollector(this TracerBuilder builder)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            return(builder.AddCollector(t => new AspNetCoreCollector(t)));
        }
        /// <summary>
        /// Enables the outgoing requests automatic data collection.
        /// </summary>
        /// <param name="builder">Trace builder to use.</param>
        /// <returns>The instance of <see cref="TracerBuilder"/> to chain the calls.</returns>
        public static TracerBuilder AddDependencyCollector(this TracerBuilder builder)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            return(builder
                   .AddCollector((t) => new AzureClientsCollector(t))
                   .AddCollector((t) => new AzurePipelineCollector(t))
                   .AddCollector((t) => new HttpClientCollector(t)));
        }
Beispiel #4
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)));
        }
        /// <summary>
        /// Enables the outgoing 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 AddDependencyCollector(this TracerBuilder builder, Action <HttpClientCollectorOptions> configure)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

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

            var options = new HttpClientCollectorOptions();

            configure(options);

            return(builder
                   .AddCollector((t) => new AzureClientsCollector(t))
                   .AddCollector((t) => new AzurePipelineCollector(t))
                   .AddCollector((t) => new HttpClientCollector(t, options)));
        }