TECHNOLOGY

TruLens span groups: localize a metric to a logical hop instead of pooling a trace

In this article
THE QUICK TAKE

A logical evaluation segment can contain several spans and differs from both an individual span and the complete trace.

Define the segment you want to diagnose

A multi-step retrieval trace may contain several operations of the same type. Pooling them can hide which logical step supplied poor evidence, while judging each span separately can fragment a meaningful stage. TruLens span groups provide labels for localizing evaluation to such segments. Define the intended unit before adding labels: a retrieval hop, source family or deliberately compared strategy, rather than whichever function boundary happens to be easiest to instrument.

Keep grouping separate from metric selection

The group determines a local evaluation scope; the metric still needs appropriate selectors and an implementation. The selector guide explains how span attributes become arguments. Inspect which evidence the metric receives within each group. Merely tagging spans does not prove the resulting judgment tests the desired relationship between query, retrieved material and answer. A correctly named group can still contain incomplete or incorrectly selected evidence.

Account for nested membership

The documented grouping context merges labels when groups are nested. That means memberships can overlap rather than form a disjoint partition of the trace. Do not sum per-group counts or costs as if each underlying operation appeared only once. Preserve membership lists during diagnostics and check whether a retry should belong to its parent stage, its own diagnostic category or both. The interpretation depends on the authored grouping contract, not simply on the number of displayed groups.

Distinguish segments from conversations

The conversation evaluation guide describes a different scope that combines ordered records across turns. Span groups localize operations within an execution; conversation identity links a broader interaction. Choose the scope matching the capability claim. A good result for an individual retrieval hop does not establish that the complete conversation satisfied the user’s evolving requirements, just as a coherent final transcript can conceal a weak intermediate evidence-gathering step.

Verify boundaries with an inspectable trace

Use a diagnostic trace containing separate retrieval steps, a nested retry and an ungrouped operation. Check group attributes and the actual metric inputs for each segment. The guides to pooled evidence versus aggregation and trace export completeness provide related controls. Accept the design when group membership makes failures more localizable without inventing mutually exclusive partitions or extending a per-segment judgment into an unmeasured claim about the entire application.

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