The IBM MQ transport instruments send, receive, and dispatch operations using System. and follows the OpenTelemetry messaging semantic conventions.
Activity source
The transport emits activities under the activity source named NServiceBus.. 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 name | Kind | Display name |
|---|---|---|
NServiceBus. | Consumer | receive {queueName} |
NServiceBus. | Internal | dispatch |
NServiceBus. | Producer | send {destination} |
NServiceBus. | Producer | publish {topicName} |
NServiceBus. | Internal | (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:
| Tag | Activities | Value |
|---|---|---|
messaging. | All | ibm_mq |
messaging. | Receive, PutToQueue, PutToTopic | Queue or topic name |
messaging. | Receive, PutToQueue, PutToTopic | receive, send, or publish |
messaging. | PutToQueue, PutToTopic | Native MQ message ID as a hex string |
messaging. | Dispatch | Total number of outgoing operations in the batch |
Vendor-specific tags
| Tag | Activities | Value |
|---|---|---|
nservicebus. | PutToTopic | The IBM MQ topic string used to open the topic |
nservicebus. | Receive, Attempt | Number 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:
| Event | When |
|---|---|
mq. | Transaction committed successfully |
mq. | Transaction 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.