An order service publishes a fraud-check job and waits for a result. Its publish operation is quick. The worker's call to the fraud provider is quick. Yet the customer waits. Between those two measured operations, the job might have sat in a broker, been delivered to a busy consumer, waited inside a local worker pool, or been retried after an earlier attempt failed. The endpoints of the handoff can both look healthy while the handoff dominates the response time.

This is an illustrative scenario, not a report of an actual incident. It shows a specific weakness in distributed investigations: asynchronous work creates intervals whose owner is unclear. A trace can record that one operation led to another without measuring the time between them. The central question is not simply how to collect more logs or spans. It is how to locate the missing interval closely enough to choose a defensible response.

The queue is more than a line between spans

At an asynchronous boundary, “sent” and “processed” are not adjacent events. A publish call may finish when a broker accepts a message, depending on the client and acknowledgment mode. The broker may then hold the message until a consumer can take it. A consumer library may prefetch it before application code begins work. Processing may complete before the acknowledgment reaches the broker. Each transition has a different clock and a different failure mode.

That matters because interventions depend on where the wait occurred. More workers may help when ready messages accumulate and consumers are saturated. They may do little for a blocked partition, a message repeatedly failing and being redelivered, or a worker that has accepted jobs but cannot schedule their handlers. A faster external provider will not repair time spent before its request was sent. Queue depth alone cannot distinguish those cases: it is a stock of work at a moment, while the incident concerns how long particular work waited and why throughput changed.

Broker metrics make some of these states visible, but their meanings are system-specific. RabbitMQ's monitoring documentation separates messages ready for delivery from messages delivered but not yet acknowledged. Apache Kafka's consumer metric records-lag-max is a count of records behind on a partition, not a duration experienced by an individual order. Amazon SQS's ApproximateAgeOfOldestMessage reports an approximate age and has documented exclusions for repeatedly received messages. Treating any one of these numbers as “the queue time” for the affected request would overstate what it measures.

Reconstruct the handoff, then test the gap

An investigation should first determine whether the delay belongs to all jobs or a particular route, message class, tenant, partition, or deployment version. The request's end-to-end latency establishes the user symptom; broker ingress and egress rates, backlog, and consumer concurrency establish whether work is accumulating. Those aggregates narrow the search but do not identify the journey of one job.

For a sampled affected job, the useful sequence is: producer hands the message to its client; broker acknowledges acceptance; broker makes the message available; consumer receives or is delivered it; the application handler starts; the handler finishes; and the broker records settlement. Instrumentation will rarely expose every point. Name the boundaries that are actually measured. A producer span and a handler span, for instance, leave an interval that could include broker residence, prefetch, and local scheduling. The size of that interval in a trace view is also vulnerable to clock differences across hosts.

Measure the disputed wait at the component that owns it. Broker-observed age can support a queue-residence hypothesis, within that broker's documented semantics. A local timer between consumer receipt and handler start can reveal scheduling delay without subtracting timestamps from two machines. Handler duration and time to acknowledgment separate slow application work from slow settlement. If the broker cannot report per-message residence, a cohort-level age measure and correlated event records may still narrow the cause, but the report should say that individual queue time remains unknown.

Suppose, still hypothetically, the affected job class shows rising ready backlog while worker throughput falls after a deployment. That pattern favors a capacity or scheduling problem before the provider call. It does not establish whether a concurrency limit changed, handlers became slower, or one partition stopped making progress. Compare worker occupancy, processing-duration distributions, failure and redelivery counts, and partition or consumer-group state before selecting a mitigation. A rollback under comparable load can strengthen the case for a deployment-related regression; it cannot make an unmeasured interval magically observed.

A shared trace ID does not measure the wait

Context propagation is necessary to connect producer and consumer evidence. The producer must attach a trace context to message metadata, and the consumer must extract it. OpenTelemetry's messaging conventions generally use span links to relate consumer work to a message's creation context, including cases where batches or multiple consumers make a single parent relationship inadequate. For a single message, a consumer may instead use that context as a parent. These relationships answer which work is connected; they do not reveal how long the message waited in every intermediate state.

Propagation and recording are also separate. The OpenTelemetry trace model permits context to pass through a service whose span is not exported. Sampling, filtering, delayed export, and query boundaries can create a trace fragment. If a queue consumer starts a new trace without a link, the producer and worker may look unrelated despite both being instrumented. If the link is present, the causal relationship is preserved, but a viewer must support following it; the two traces do not become one continuous waterfall.

A stable message or conversation identifier can help join broker, producer, and consumer records when tracing coverage is incomplete. It should be handled as controlled, per-request evidence rather than used as a metric label. Prometheus warns against unbounded label values because each unique label combination creates a time series. The identifier itself also needs retention and access rules when it can be associated with a customer or transaction.

The evidence has its own failure modes

An incident can damage the system that records it. Export queues can fill, and traces can arrive late or be dropped; OpenTelemetry documents these Collector loss modes. A broker's aggregate metrics may continue while per-message logs expire, or the reverse. Before concluding that a job did not pass a boundary, check whether the relevant producer, consumer, and telemetry pipeline were recording during the interval. Absence of a record is persuasive only when the recording path was expected to produce one and is known to have worked.

The practical goal is a small set of measurements that separate operational choices. Ready and unacknowledged counts point to different RabbitMQ states. Consumer lag and processing rate distinguish accumulation from a brief traffic burst in Kafka, though lag is not elapsed time. A local scheduling timer separates work already delivered from work still at the broker. Message correlation and trace links connect the same job across those views. None is a universal answer; together, chosen for the queue in use, they can turn an unexplained gap into a testable account.

Asynchronous incidents are difficult because a missing second can belong to several components without appearing inside any component's handler span. The strongest investigation identifies which transition is unmeasured, collects evidence from the owner of that transition, and states what remains uncertain. That discipline produces a better fix than attaching a cause to the nearest visible span.

References