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))); }
/// <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); }
public QuartzDiagnosticListener(string sourceName, QuartzInstrumentationOptions options) : base(sourceName) { this.options = options ?? throw new ArgumentNullException(nameof(options)); }
public QuartzDiagnosticListener(string sourceName, QuartzInstrumentationOptions options, ActivitySourceAdapter activitySource) : base(sourceName) { this.options = options ?? throw new ArgumentNullException(nameof(options)); this.activitySource = activitySource; }