/// <summary>
        /// Enables Application Insights exporter.
        /// </summary>
        /// <param name="builder">Trace builder to use.</param>
        /// <param name="applicationInsightsConfigure">Configuration options.</param>
        /// <param name="processorConfigure">Span processor configuration.</param>
        /// <returns>The instance of <see cref="TracerBuilder"/> to chain the calls.</returns>
        public static TracerBuilder UseApplicationInsights(this TracerBuilder builder, Action <TelemetryConfiguration> applicationInsightsConfigure, Action <
                                                               SpanProcessorPipelineBuilder> processorConfigure)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

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

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

            var options = new TelemetryConfiguration();

            applicationInsightsConfigure(options);
            return(builder.AddProcessorPipeline(b =>
            {
                b.SetExporter(new ApplicationInsightsTraceExporter(options));
                processorConfigure.Invoke(b);
            }));
        }
Beispiel #2
0
        /// <summary>
        /// Registers Jaeger exporter.
        /// </summary>
        /// <param name="builder">Trace builder to use.</param>
        /// <param name="configure">Exporter configuration options.</param>
        /// <param name="processorConfigure">Span processor configuration.</param>
        /// <returns>The instance of <see cref="TracerBuilder"/> to chain the calls.</returns>
        public static TracerBuilder UseJaeger(this TracerBuilder builder, Action <JaegerExporterOptions> configure, Action <SpanProcessorPipelineBuilder> processorConfigure)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

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

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

            var options = new JaegerExporterOptions();

            configure(options);
            return(builder.AddProcessorPipeline(b =>
            {
                b.SetExporter(new JaegerTraceExporter(options));
                processorConfigure.Invoke(b);
            }));
        }
        /// <summary>
        /// Enables Application Insights exporter.
        /// </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 UseApplicationInsights(this TracerBuilder builder, Action <TelemetryConfiguration> configure)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

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

            var configuration = new TelemetryConfiguration();

            configure(configuration);
            return(builder.AddProcessorPipeline(b => b
                                                .SetExporter(new ApplicationInsightsTraceExporter(configuration))
                                                .SetExportingProcessor(e => new BatchingSpanProcessor(e))));
        }
Beispiel #4
0
        /// <summary>
        /// Registers a Jaeger exporter.
        /// </summary>
        /// <param name="builder">Trace builder to use.</param>
        /// <param name="configure">Exporter configuration options.</param>
        /// <returns>The instance of <see cref="TracerBuilder"/> to chain the calls.</returns>
        public static TracerBuilder UseJaeger(this TracerBuilder builder, Action <JaegerExporterOptions> configure)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

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

            var options = new JaegerExporterOptions();

            configure(options);
            return(builder.AddProcessorPipeline(b => b
                                                .SetExporter(new JaegerTraceExporter(options))
                                                .SetExportingProcessor(e => new BatchingSpanProcessor(e))));
        }