Getting Started
Architecture
NServiceBus
Transports
Persistence
ServiceInsight
ServicePulse
ServiceControl
Monitoring
Modernization
Samples

Observability

Component: IBM MQ Transport

The IBM MQ transport instruments send, receive, and dispatch operations using System.Diagnostics.Activity and follows the OpenTelemetry messaging semantic conventions.

Activity source

The transport emits activities under the activity source named NServiceBus.Transport.IBMMQ. Register this source with the OpenTelemetry tracer provider to collect transport-level spans:

builder.Services.AddOpenTelemetry()
    .WithTracing(tracing => tracing
        .AddSource("NServiceBus.Transport.IBMMQ")
        .AddOtlpExporter());

Activities

The following activities are created for each transport operation:

Activity nameKindDisplay name
NServiceBus.Transport.IBMMQ.ReceiveConsumerreceive {queueName}
NServiceBus.Transport.IBMMQ.DispatchInternaldispatch
NServiceBus.Transport.IBMMQ.PutToQueueProducersend {destination}
NServiceBus.Transport.IBMMQ.PutToTopicProducerpublish {topicName}
NServiceBus.Transport.IBMMQ.AttemptInternal(unnamed)

The Attempt activity wraps each processing attempt inside the immediate retry loop. It records failure details when message processing raises an exception.

NServiceBus core parents its receive pipeline activity to the transport Receive activity, producing a complete trace from transport dequeue through handler execution.

Tags

Standard messaging tags

These tags follow the OpenTelemetry messaging semantic conventions:

TagActivitiesValue
messaging.systemAllibm_mq
messaging.destination.nameReceive, PutToQueue, PutToTopicQueue or topic name
messaging.operation.typeReceive, PutToQueue, PutToTopicreceive, send, or publish
messaging.message.idPutToQueue, PutToTopicNative MQ message ID as a hex string
messaging.batch.message_countDispatchTotal number of outgoing operations in the batch

Vendor-specific tags

TagActivitiesValue
nservicebus.transport.ibmmq.topic_stringPutToTopicThe IBM MQ topic string used to open the topic
nservicebus.transport.ibmmq.failure_countReceive, AttemptNumber of processing failures for the current message

Activity events

The following events are added to the active receive activity when a transaction outcome is recorded:

EventWhen
mq.commitTransaction committed successfully
mq.backoutTransaction backed out (message returned to queue)

Error status

When an operation fails, the activity status is set to Error with the exception message as the description. This applies to Receive, Dispatch, PutToQueue, PutToTopic, and Attempt activities.

Related Articles

  • OpenTelemetry
    Observability of NServiceBus endpoints with OpenTelemetry.