fn calls_branch(
traces: &[CallsSource],
window: &GraphQueryWindow,
) -> Result<Option<DataFrame>>Expand description
The calls derivation: union the client spans and the server spans of all
trace tables (each projected to a normalized shape with its own table’s
service identity), left-join clients to their child server spans on
trace_id + parent_span_id, and aggregate RED metrics per 60s window —
the plan form of the Tempo servicegraph connector. Unioning spans before
the join pairs a client with a server stored in a different trace table
(x-greptime-trace-table-name routing); with a single table it degenerates
to the previous self-join. Returns None when no trace table has a
usable service declaration.
A client with no matching server span is an edge to a virtual node
named by the conventions’ virtual-destination candidates, with the
client’s own status/duration
and confidence < 1.0. Real pairs win: when a window’s edge key holds any
pair, the edge reports only the pair population (the RFC pins RED metrics
to observed span pairs) and the unmatched clients are suppressed, so one
(window, edge) never yields two rows. unmatched_count stays outside the
rule and counts them on the same row.