Skip to content

Waterfall

The spans of a trace on one time line: what ran, when it started, how long it took and what ran inside it. A failing span is marked in words and colour.

import { Waterfall } from '@sypnia/ui/react'

On this page
  1. A request and what it did
  2. When to use it
  3. For everyone
  4. Props

A request and what it did

GET /orders/1042
Trace 7f3a9c · 412 ms
  1. GET /orders/1042412 ms
  2. auth.verify22 ms
  3. db.query orders140 ms
  4. db.query items180 ms
  5. retry items120 ms
  6. render json48 ms
View as table
StartsTakes
GET /orders/10420 ms412 ms
auth.verify4 ms22 ms
db.query orders30 ms140 ms
db.query items175 ms180 ms
retry items210 ms120 ms
render json360 ms48 ms
Code
import { Waterfall } from '@sypnia/ui/react';

// One request and everything it did. The failing query is marked in words and colour.
export default function Trace() {
  return <Waterfall title="GET /orders/1042" subtitle="Trace 7f3a9c · 412 ms" spans={[
    { id: '1', label: 'GET /orders/1042', start: 0, duration: 412 },
    { id: '2', label: 'auth.verify', start: 4, duration: 22, depth: 1 },
    { id: '3', label: 'db.query orders', start: 30, duration: 140, depth: 1 },
    { id: '4', label: 'db.query items', start: 175, duration: 180, depth: 1, failed: true },
    { id: '5', label: 'retry items', start: 210, duration: 120, depth: 2 },
    { id: '6', label: 'render json', start: 360, duration: 48, depth: 1 },
  ]} />;
}

When to use it

Use it when

  • Traces of a request, steps of a job.

Do not use it when

  • Totals that add and subtract: that is a different chart.

For everyone

  • Each span is named with when it started, how long it took, and whether it failed.
  • Nesting is shown by indentation, not by colour alone.

Props

WaterfallTypeDefault
spansrequired Span[]
titlerequired ReactNode
empty ReactNode
error ReactNode
formatDuration Fmt
height number
loading boolean
subtitle ReactNode
  1. A request and what it did
  2. When to use it
  3. For everyone
  4. Props

    Search pages, sections and terms