コード例 #1
0
        public static TracerProviderBuilder AddQuartzInstrumentation(
            this TracerProviderBuilder builder,
            Action <QuartzInstrumentationOptions>?configure = null)
        {
            var options = new QuartzInstrumentationOptions();

            configure?.Invoke(options);
            return(builder.AddInstrumentation(t => new QuartzJobInstrumentation(t, options)));
        }
コード例 #2
0
        /// <summary>
        /// Enables the Quartz.NET Job automatic data collection for Quartz.NET.
        /// </summary>
        /// <param name="builder"><see cref="TraceProviderBuilderExtensions"/> being configured.</param>
        /// <param name="configureQuartzInstrumentationOptions">Quartz configuration options.</param>
        /// <returns>The instance of <see cref="TraceProviderBuilderExtensions"/> to chain the calls.</returns>
        public static TracerProviderBuilder AddQuartzInstrumentation(
            this TracerProviderBuilder builder,
            Action <QuartzInstrumentationOptions> configureQuartzInstrumentationOptions = null)
        {
            var options = new QuartzInstrumentationOptions();

            configureQuartzInstrumentationOptions?.Invoke(options);

            builder.AddInstrumentation(() => new QuartzJobInstrumentation(options));
            builder.AddSource(QuartzDiagnosticListener.ActivitySourceName);

            builder.AddLegacySource(OperationName.Job.Execute);
            builder.AddLegacySource(OperationName.Job.Veto);

            return(builder);
        }
コード例 #3
0
 public QuartzDiagnosticListener(string sourceName, QuartzInstrumentationOptions options)
     : base(sourceName)
 {
     this.options = options ?? throw new ArgumentNullException(nameof(options));
 }
コード例 #4
0
 public QuartzDiagnosticListener(string sourceName, QuartzInstrumentationOptions options, ActivitySourceAdapter activitySource)
     : base(sourceName)
 {
     this.options        = options ?? throw new ArgumentNullException(nameof(options));
     this.activitySource = activitySource;
 }