Observability

The transport emits OpenTelemetry activities under the source NServiceBus.Transport.NonDurable.

Activity nameKindDescription
NServiceBus.Transport.NonDurable.SendProducerA message is dispatched to a destination queue.
NServiceBus.Transport.NonDurable.ScheduleProducerA delayed delivery message is scheduled.
NServiceBus.Transport.NonDurable.ProcessConsumerA message is received and processed.

These activities describe the raw transport interactions and are emitted under the transport's own activity source. Enabling or configuring the NServiceBus Core OpenTelemetry does not change this behavior. Core emits its own activities under the NServiceBus.Core source. Options such as StartNewTraceOnReceive() and ContinueExistingTraceOnReceive() control how Core's activities correlate to each other; they do not affect the transport activities described here.

Span correlation

The Process span is a root span. It correlates to the producer span that created the message through an activity link, following the OpenTelemetry messaging semantic conventions. The producer span is parented to the handler activity that performed the send.

Keeping the consumer side of each hop a root span prevents trace depth from growing with every hop in self-feeding and saga message chains. Each message's processing is a bounded sub-trace, with causal linkage preserved via the link.

flowchart LR; subgraph PRODUCER direction TB SEND[NServiceBus.Transport.NonDurable.Send span] end subgraph CONSUMER direction TB PROCESS[NServiceBus.Transport.NonDurable.Process span] end SEND-. link .-PROCESS;

With inline execution enabled, a message processed synchronously within the send uses the producer span as its parent. The Process span is a child of the Send span and carries no links, mirroring the synchronous call stack.

flowchart LR; subgraph PRODUCER direction TB SEND[NServiceBus.Transport.NonDurable.Send span] end subgraph CONSUMER direction TB PROCESS[NServiceBus.Transport.NonDurable.Process span] end SEND--child--> PROCESS;

Delayed delivery is processed asynchronously by the message pump even when inline execution is enabled. Delayed messages therefore keep the root span and link correlation described above.

Tags include messaging.system = nondurable, messaging.destination.name, messaging.operation.name, messaging.message.id, and messaging.message.conversation_id.

Related Articles

  • OpenTelemetry
    Observability of NServiceBus endpoints with OpenTelemetry.