Table of Contents

Method FilterSubjects

Namespace
NATS.Client.OpenTelemetry
Assembly
NATS.Client.OpenTelemetry.dll

FilterSubjects(NatsInstrumentationOptions, string[]?, string[]?)

Restricts tracing to operations whose subject matches the given NATS subject patterns.

public static NatsInstrumentationOptions FilterSubjects(this NatsInstrumentationOptions options, string[]? include = null, string[]? exclude = null)

Parameters

options NatsInstrumentationOptions

The options to configure.

include string[]

Subject patterns to trace. An operation is traced only if its subject matches at least one pattern. When null or empty, every subject is eligible (still subject to exclude).

exclude string[]

Subject patterns to skip. An operation matching any of these is not traced, even when it also matches an include pattern. A common use is dropping inbox traffic with _INBOX.>.

Returns

NatsInstrumentationOptions

The same options instance for chaining.

Remarks

Patterns use NATS subject wildcards: * matches a single token and > matches one or more trailing tokens. The resulting predicate is combined (logical AND) with any existing Filter, so a previously configured filter still applies.