TECHNOLOGY

Dynamic inference batches: preserve many request causes with span links

In this article
THE QUICK TAKE

A batch span needs explicit links to participating requests; choosing one parent does not describe every contributor.

The diagnostic situation

A scheduler combines independently submitted requests into a shared model execution. A tracing wrapper chooses the context that happened to be active when the batch was assembled. The resulting tree makes that request look like the sole cause of execution, while the other contributors appear unrelated. Investigators then attribute shared queue or compute time to the wrong request.

Why the observation changes meaning

OpenTelemetry gives a span at most one parent, while links can reference contexts from the same or different traces. Links therefore represent a many-input relationship without pretending all input requests share a parent. They do not divide the batch duration among requests or prove that every linked request completed successfully. That accounting requires separate scheduler evidence.

Define the instrumentation contract

Define the batch observation as an execution instance, with a safe batch identifier and a membership snapshot. Preserve the mapping from each admitted request to its batch participation. Where contexts are available before span creation, provide links then: later links cannot retroactively influence a head-sampling decision. Keep tenant content and arbitrary request text outside link attributes.

A bounded verification procedure

First construct independent synthetic request contexts and arrange for them to enter one batch. Record expected membership before instrumentation transforms it. Next capture spans at a test exporter and compare parent identity, link targets and scheduler membership. Repeat with a cancelled participant and a request deferred into another batch. Verify actual execution membership rather than copying the queue snapshot indiscriminately.

Evidence required for acceptance

Acceptance evidence includes the batching configuration, instrumentation version, membership records and exported link targets. Show unmatched requests and links whose target traces were not retained. A link can remain useful as a correlation key even when its target is unavailable, but the viewer must not display the missing trace as proof of absent application work. Check link limits separately.

Failure cases and limits

A busy batch may have more participants than the configured link limit. Truncating links without a visible dropped count can recreate apparent single-request ownership. Preserve bounded diagnostic membership elsewhere when needed, with an explicit retention policy. This protocol validates causal representation of shared execution; it does not establish per-request GPU time, fair resource allocation or complete tracing across external services.

A batch span needs explicit links to participating requests; choosing one parent does not describe every contributor. OpenTelemetry tracing API specification; OpenTelemetry tracing SDK specification.

The proposed investigation of dynamic batch span links is not an executed deployment benchmark. Related reading: Request IDs and trace context across gateway, API and engine; Continuous batching: why concurrent requests change GPU value.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles