/// <summary> /// Enables the outgoing requests automatic data collection for MassTransit. /// </summary> /// <param name="builder"><see cref="TracerProviderBuilderExtensions"/> being configured.</param> /// <param name="configureMassTransitInstrumentationOptions">MassTransit configuration options.</param> /// <returns>The instance of <see cref="TracerProviderBuilderExtensions"/> to chain the calls.</returns> public static TracerProviderBuilder AddMassTransitInstrumentation( this TracerProviderBuilder builder, Action <MassTransitInstrumentationOptions> configureMassTransitInstrumentationOptions = null) { if (builder == null) { throw new ArgumentNullException(nameof(builder)); } var options = new MassTransitInstrumentationOptions(); configureMassTransitInstrumentationOptions?.Invoke(options); return(builder.AddInstrumentation(activitySource => new MassTransitInstrumentation(activitySource, options))); }
/// <summary> /// Enables the outgoing requests automatic data collection for MassTransit. /// </summary> /// <param name="builder"><see cref="TracerProviderBuilderExtensions"/> being configured.</param> /// <param name="configureMassTransitInstrumentationOptions">MassTransit configuration options.</param> /// <returns>The instance of <see cref="TracerProviderBuilderExtensions"/> to chain the calls.</returns> public static TracerProviderBuilder AddMassTransitInstrumentation( this TracerProviderBuilder builder, Action <MassTransitInstrumentationOptions> configureMassTransitInstrumentationOptions = null) { if (builder == null) { throw new ArgumentNullException(nameof(builder)); } var options = new MassTransitInstrumentationOptions(); configureMassTransitInstrumentationOptions?.Invoke(options); builder.AddInstrumentation(() => new MassTransitInstrumentation(options)); builder.AddSource(MassTransitDiagnosticListener.ActivitySourceName); builder.AddLegacySource(OperationName.Consumer.Consume); builder.AddLegacySource(OperationName.Consumer.Handle); builder.AddLegacySource(OperationName.Transport.Send); builder.AddLegacySource(OperationName.Transport.Receive); return(builder); }
public MassTransitDiagnosticListener(string name, MassTransitInstrumentationOptions options) : base(name) { this.options = options; }
public MassTransitDiagnosticListener(ActivitySourceAdapter activitySource, MassTransitInstrumentationOptions options) : base("MassTransit") { this.activitySource = activitySource; this.options = options; }