Method AddNatsClientInstrumentation
- Namespace
- NATS.Client.OpenTelemetry
- Assembly
- NATS.Client.OpenTelemetry.dll
AddNatsClientInstrumentation(TracerProviderBuilder)
Adds the NATS .NET client ActivitySource to the tracer provider, enabling distributed tracing for publish, subscribe, and request/reply operations.
public static TracerProviderBuilder AddNatsClientInstrumentation(this TracerProviderBuilder builder)
Parameters
builderTracerProviderBuilderThe OpenTelemetry.Trace.TracerProviderBuilder to add the source to.
Returns
- TracerProviderBuilder
The supplied
builderfor chaining.
AddNatsClientInstrumentation(TracerProviderBuilder, Action<NatsInstrumentationOptions>)
Adds the NATS .NET client ActivitySource to the tracer provider and configures the shared NatsInstrumentationOptions.
public static TracerProviderBuilder AddNatsClientInstrumentation(this TracerProviderBuilder builder, Action<NatsInstrumentationOptions> configure)
Parameters
builderTracerProviderBuilderThe OpenTelemetry.Trace.TracerProviderBuilder to add the source to.
configureAction<NatsInstrumentationOptions>Action that mutates the process-wide Default.
Returns
- TracerProviderBuilder
The supplied
builderfor chaining.
AddNatsClientInstrumentation(MeterProviderBuilder)
Adds the NATS .NET client Meter to the meter provider, enabling messaging metrics (published/consumed counters, operation duration, and more).
public static MeterProviderBuilder AddNatsClientInstrumentation(this MeterProviderBuilder builder)
Parameters
builderMeterProviderBuilder
Returns
- MeterProviderBuilder