hamsa software
← All articles
Integrations7 min read

One order, several attempts, more than one trace

Business identity and diagnostic identity have different lifetimes. Connecting them makes the waiting between systems visible.

Three interweaving curved strands lead toward a small separate circle, evoking the relationship between one business order and its multiple diagnostic attempts.

The order is not the trace

The request log says success. Support still needs to know where the order is. Checkout accepted it, a worker finished and a message reached another system—but the customer asked whether the warehouse has it. Those observations need to meet in one durable order record before the colleague can answer. A successful request is a useful detail; it is a surprisingly optimistic description of the whole journey.

The website, queue and warehouse may each assign a different reference, while a retry starts another trace and a batch combines several orders. If the application does not retain their relationships, support may have to search across systems using a customer's email. A stable business identity avoids that reconstruction and reduces the need to distribute personal data through diagnostic records merely to find related work.

Tracing helps explain related instrumented work. It does not automatically give an order its business identity. The order can live for days, cross several traces and return in more than one attempt. Connect those records deliberately so a colleague can follow the obligation without keeping a trace open until the parcel arrives. Otherwise the diagnostic picture can be detailed and still leave the customer’s question unanswered.

For the fictional O-204, checkout accepts the order at 10:00. A worker first attempts warehouse submission at 10:02; a second attempt receives acknowledgement at 10:06. The warehouse later creates shipment S-77. Keep those observations on the order’s durable timeline, linked to the attempts that produced them. The acknowledgement and later shipment tell support how far the order has reached, while their trace links explain the executions involved.

Use the business identity to answer which order this concerns. Use an attempt identity to distinguish one execution from another. Use trace and span identities to inspect instrumented work and its timing. A provider reference such as S-77 adds another boundary: it identifies the external object that the business record is associated with.

Keep A-1 and A-2 under O-204 so a retry does not look like another customer order. Keep them distinguishable as attempts as well: combining their lines without that distinction can make one request appear to fail and succeed at once. Each needs a start, the result actually observed and a route to its diagnostic detail. The relationship makes the operating history easier to read without pretending both executions were one process.

Avoid turning every order identity into a metric label as a shortcut to correlation. Per-order diagnostic records and aggregate service metrics serve different purposes. A useful count of awaiting orders does not need a separate time series for every customer transaction; it needs a route from the aggregate symptom to the appropriately authorised records.

Do not use these identifiers as substitutes for authorisation. A person who knows O-204 should still need permission to inspect its details. An identifier that is useful for support can be opaque and copyable without exposing a customer’s email address in every span attribute. Decide what diagnostic data belongs in the tracing system and who can read it.

It is also worth distinguishing a deduplication identity from an attempt identity. Two attempts may intentionally represent the same business action and therefore share the appropriate deduplication key under the receiver’s contract. Giving every retry a fresh action identity can defeat that protection. Giving every operation the same attempt identity makes its diagnostic history needlessly difficult to understand.

Which identifier answers which question for O-204?

The order’s correlation model is independent of the six-minute timing ledger.

Scroll sideways to see all columns.

IdentityExampleQuestion
Business orderO-204Which customer obligation?
Execution attemptA-1 / A-2Which submission attempt?
Trace and spanLinked instrumented workWhat ran and where did it wait?
External objectS-77Which warehouse shipment?
Attempts may share a business-action deduplication identity without sharing their diagnostic identities.

Follow the asynchronous edge

OpenTelemetry describes spans as units of work, with attributes, events and context. It also provides span links for causal relationships, including work queued for later execution in another trace. That is a useful fit for an order that leaves the web request and resumes in a worker. The relationship matters even when the later work cannot be represented as a neat synchronous call.

At enqueue time, record the message identity, the relevant business reference and the tracing context that the instrumentation needs. At consumption, create the appropriate span or trace relationship for the actual system. A batch consumer may process messages from several origins, so pretending it has one simple parent can misrepresent what happened. Links can express relationships that a single parent chain cannot.

Store the business transition even if diagnostic export fails. The tracing collector can be unavailable and sampling can omit a trace, while O-204 still needs to show its acceptance and the warehouse information received. Telemetry can explain the route in greater detail when available. It should not be the only place the business remembers an order it has already agreed to fulfil, or support will lose the obligation whenever a diagnostic record goes missing.

Conversely, a business status such as submitted should not erase the diagnostic distinction between an acknowledgement and a later fulfilment event. The warehouse accepting an order, allocating stock and dispatching a parcel are separate boundaries. The operating view should show which one is known, then offer the corresponding trace or provider reference when a colleague needs to investigate it.

The six minutes contain different kinds of waiting

The illustrative journey from 10:00 acceptance to 10:06 warehouse acknowledgement takes six minutes. Break it down before deciding that the warehouse API was slow. Two minutes pass before A-1 starts. A-1 runs for thirty seconds, then recovery waits three minutes. A-2 starts at 10:05:30 and receives acknowledgement thirty seconds later. The total is two minutes of initial waiting, one minute of active attempts and three minutes of recovery delay.

That breakdown changes where to look. A faster warehouse request cannot recover the first two minutes in the queue. More workers may leave a deliberate provider-limit retry delay unchanged. Removing that delay blindly may just replace waiting with rejected calls. Name queue wait, active attempts and recovery delay in the timeline so the improvement addresses the part of the six minutes that is actually causing the customer to wait.

Viewed alone, A-2 has a thirty-second duration, while the customer has waited six minutes since acceptance. Linking the attempt traces to the operating timeline explains both measurements. The team can then examine whether queue scheduling, recovery delay or active request time causes the wait, and choose an improvement or customer-facing estimate that addresses the whole journey rather than only its fastest visible segment.

Use event occurrence time and observation time carefully. A delayed shipment notification can arrive after a later warehouse update. Record the provider’s event identity and timestamp where available, alongside when the integration received it. Do not build a business history simply by sorting log arrival times and assuming the network preserved the order of reality.

Where O-204 spent its six minutes

An illustrative acceptance-to-acknowledgement timeline, broken into waiting and active attempts.

Scroll sideways to see all columns.

IntervalWhat happenedElapsed
10:00–10:02Initial queue wait2 min
10:02–10:02:30Attempt A-10.5 min
10:02:30–10:05:30Recovery delay3 min
10:05:30–10:06Attempt A-2 acknowledged0.5 min
Synthetic timings: 2 + 0.5 + 3 + 0.5 = 6 minutes. A thirty-second successful attempt does not describe the whole order journey.

Let the support question shape the view

A useful order page might show accepted, awaiting warehouse acknowledgement, acknowledged and dispatched, with the latest relevant evidence for each. Keep unresolved attempts visible without making the colleague read every low-level event. The default view should answer the customer’s question; the diagnostic links should support the next investigation.

For O-204, the page could say that the warehouse acknowledged the order at 10:06 and provide its external reference. If shipment S-77 is subsequently created, attach that event to the same business record. If an earlier attempt later produces another acknowledgement, flag the discrepancy rather than quietly replacing the first reference. Correlation makes such problems findable; it does not itself reconcile them.

Review the design with several awkward journeys: a retry in a new trace, a batch containing two orders, a missing diagnostic export and an external update arriving late. For each, ask whether the business record remains understandable and whether a colleague can reach the relevant evidence. These tests concern the links between records, not merely whether an instrumentation library emits spans.

There is no need to keep every detail forever. Retention, sampling and privacy remain real constraints, especially for a small business paying for its own observability. Preserve durable business outcomes according to their requirements and retain diagnostic detail proportionately. The important architectural choice is that losing a sampled trace must not make an accepted order disappear from the account of work.

Support should be able to open O-204, find its two attempts and follow the link to shipment S-77. The customer order, attempted submissions, instrumented work and external shipment answer different questions, and their relationships carry the explanation. Preserve those links even if sampling loses a trace or a warehouse notification arrives late. Then the six-minute wait can be investigated through the order the customer knows, instead of asking them to supply the tracing context they never saw.

Working on a workflow like this? Hamsa helps finance and operations teams connect their tools and handle the exceptions, starting with one workflow.

See the Payment Operations Pilot

References & further reading

Primary sources behind this article. Living documentation may change.

  1. OpenTelemetry: Traces, spans and span links
Hamsa Jama

Practical engineering. A human perspective.

More about Hamsa Software and the person behind it. Editorial notes.

A few more things
worth a read.

Back to the reading room
Integrations7 min read

A valid signature still needs a trust decision

An Oprindo sample had a matching asset hash and a valid signature, alongside an untrusted credential result. The useful story is in those separate answers.

Integrations6 min read

Should this old instruction still run?

Repairing a consumer makes replay possible. Current state, dependencies and recovery admission decide whether it is still appropriate.

Integrations7 min read

The backfill arrived after the live update

Historical work needs a population boundary, revision policy and crash-safe checkpoint strategy before its final page can mean done.