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.
Technologies #
| Family | Examples | Collection |
|---|---|---|
| Brokers | Kafka, RabbitMQ, ActiveMQ, IBM MQ | OneAgent (clients), extensions and broker metrics |
| Cloud services | Amazon SQS et SNS, Azure Service Bus, Google Pub/Sub | cloud integrations, OneAgent or OpenTelemetry on the application side |
2. A trace through the queue #
Propagating context.
The principle #
- 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 #
| Indicator | Meaning |
|---|---|
| Produced / consumed throughput | a lasting gap means the queue grows |
| Consumer lag | pending messages (Kafka: per consumer group and partition) |
| Processing time | consumer span time, p95 |
| Errors and dead-letter queues | rejected messages, retries, dead-letter queue filling up |
| Age of oldest message | the 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 desc4. 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 spansby: { messaging.destination.name, span.kind }: per queue and rolekafka-consumer-groups.sh --describe --group <groupe>: Kafka lag on the command linetraceparent: 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.
