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
optionsNatsInstrumentationOptionsThe options to configure.
includestring[]Subject patterns to trace. An operation is traced only if its subject matches at least one pattern. When
nullor empty, every subject is eligible (still subject toexclude).excludestring[]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
optionsinstance 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.