RousselTMLEARNING

Observability

Message Queues in Dynatrace

Observing message queues with Dynatrace: Kafka, RabbitMQ, ActiveMQ, IBM MQ, Amazon SQS and Azure Service Bus, end-to-end traces through the queue, producers and consumers, lag, failed messages and dead-letter queues, and alerts.

1. Why queues are hard to observe #

Asynchrony breaks the big picture.

The problem #

Good to know : Dynatrace SaaS, third-generation platform (Grail, AppEngine). The apps mentioned are in the app launcher; some depend on the licence (Dynatrace Platform Subscription).

In an asynchronous architecture, the user request finishes before the message is processed: a consumer-side error does not show in the HTTP response, and a slow consumer grows the queue with no visible alert. The Message Queues app brings producers, queues and consumers together.

Message Queues

Technologies #

FamilyExamplesCollection
BrokersKafka, RabbitMQ, ActiveMQ, IBM MQOneAgent (clients), extensions and broker metrics
Cloud servicesAmazon SQS et SNS, Azure Service Bus, Google Pub/Subcloud integrations, OneAgent or OpenTelemetry on the application side

2. A trace through the queue #

Propagating context.

The principle #

A trace through a queue
  • The producer creates a producer span and puts the trace context (traceparent) in message headers.
  • The consumer reads this header and creates a consumer span attached to the same trace: the request and its asynchronous processing are linked.
  • OneAgent does it automatically for supported clients; with OpenTelemetry, use messaging instrumentations and messaging.* conventions.
Watch out : Batch processing (a consumer reads 500 messages at once) links one span to several traces through span links rather than parent-child: a single trace waterfall then shows only part of the processing.

3. Indicators #

Throughput, duration, errors, lag.

What to track #

IndicatorMeaning
Produced / consumed throughputa lasting gap means the queue grows
Consumer lagpending messages (Kafka: per consumer group and partition)
Processing timeconsumer span time, p95
Errors and dead-letter queuesrejected messages, retries, dead-letter queue filling up
Age of oldest messagethe indicator closest to business impact
// Throughput and duration per queue and role (producer or consumer) over 1 h
fetch spans, from: now() - 1h
| filter isNotNull(messaging.system)
| summarize messages = count(), duration_p95 = percentile(duration, 95), errors = countIf(otel.status_code == "ERROR"),
            by: { messaging.system, messaging.destination.name, span.kind }
| sort messages desc

4. Alerting and diagnosing #

Before the queue overflows.

Rules #

  • Alert on lag or age of the oldest message, not just errors: a stopped consumer produces no error.
  • Correlate growing lag with consumer CPU, restarts and releases.
  • Watch dead-letter queues: each message there is a lost business operation until reprocessed.
  • Scale consumers on lag (KEDA, autoscaling) and check the effect in traces.

Commands to know #

Commands to know
  • fetch spans | filter isNotNull(messaging.system) : messaging spans
  • by: { messaging.destination.name, span.kind } : per queue and role
  • kafka-consumer-groups.sh --describe --group <groupe> : Kafka lag on the command line
  • traceparent : context propagation header

Sources #

Based on the official Dynatrace documentation checked in November 2026: platform apps change every month, check labels, permissions and field names in your environment before relying on a detail.

Related articles

Time-based vs event-based SLO: understanding, computing and choosing (with the Qonto example)

Differences between time-based SLOs (time slices, uptime) and event-based SLOs (good events over total): defi…

The observability trilemma: cost, completeness and performance, and how solutions resolve it

Understanding the observability trilemma (cost, data completeness, query performance), its three trade-offs, …

Accessing the Dynatrace playground and getting started

The Dynatrace playground is a demo environment full of real data: how to access it, what it allows and does n…

Keep learning

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!