Table of Contents

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

builder TracerProviderBuilder

The OpenTelemetry.Trace.TracerProviderBuilder to add the source to.

Returns

TracerProviderBuilder

The supplied builder for 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

builder TracerProviderBuilder

The OpenTelemetry.Trace.TracerProviderBuilder to add the source to.

configure Action<NatsInstrumentationOptions>

Action that mutates the process-wide Default.

Returns

TracerProviderBuilder

The supplied builder for 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

builder MeterProviderBuilder

Returns

MeterProviderBuilder