Trace timeline

N+1 groups

When the same query repeats many times (an N+1), the timeline collapses the repetitions into a single representative span and moves the details to the right panel—so a trace with hundreds of duplicate queries stays readable.

 

Design principles

  • Keep the existing timeline structure; use the right panel to provide an N+1 summary.
  • Include slowest, average, and fastest span values so the context reads at a glance.
  • Use hover states to highlight related spans so their relationships are easy to see.

Representative span & count badge

  • The first occurrence is shown as the representative span, with a count badge (e.g. x99).
  • Click the badge to expand the group and reveal the repeated spans inline in the timeline.
  • Hover the badge to highlight every span in the group (in blue), so you can see where they fall on the timeline.
Count badge (shipped example): today's x8 badge is the same pattern at small scale; the N+1 experience scales it up with expand, hover, and a summary panel.

Count badge (shipped example): today's x8 badge is the same pattern at small scale; the N+1 experience scales it up with expand, hover, and a summary panel.

 

N+1 Summary panel

Clicking the representative span opens the N+1 Summary tab: how many queries, their total duration, and what percentage of the trace they account for. A Spans card lists the slowest, mean, and fastest occurrences — clicking Slowest or Fastest jumps to that span in the timeline and highlights it.

N+1 summary  (recreated mockup)

N+1 summary (recreated mockup)

queries · total · % of trace, plus slowest / mean / fastest.

 

Nested N+1

When repetitions are nested, each level shows its own count badge, and the summary adds a Nesting panel: the chain of repeated spans, the cumulative multiplication, and a per-level breakdown. Clicking the representative span surfaces the nesting info — span name × repetition count, and the number of nesting levels.

Nesting panel (recreated mockup)

Nesting panel (recreated mockup)

the repeated-span chain, cumulative query count, and per-level detail.

 

Working inside an expanded group

After expanding, clicking an individual span shows its attributes just like any other span. A “Part of an N+1 group” message stays sticky at the bottom of the panel with a link back to the summary, so the return path is always available.