Observability appPro
An observability app for agents on scripted fixtures: every trace with its waterfall and span detail, usage with the budget, spend, latency, tokens, routing and uptime, errors grouped with a live log, and alert rules with incidents. Firing alerts and error samples open the traces behind them.
On this page
Installation
The template installs as a folder under components/chatcn/pro/observability-app/: the app, the rail, the trace list and trace view, usage, errors, alerts and the data model.
Usage
import { ObservabilityApp } from "@/components/chatcn/pro/observability-app/observability-app"
<ObservabilityApp
project="Payments"
traces={traces}
usage={usage}
errorGroups={errorGroups}
logs={logs}
alerts={alerts}
incidents={incidents}
/>Give it a height: it fills its parent. Traces carry their spans in the TraceSpan contract the Pro TraceWaterfall reads, so OpenTelemetry or your tracing backend maps onto them directly. Usage, error groups, log lines and alert rules are plain data in the shapes of obs-data.ts and the components that draw them. Mark a trace live and its waterfall grows on the clock until the spans end.
Examples
Trace with a failed span
The first search_logs call timed out and the agent retried with a narrower range. The span opens in the side panel with its error, input, output, events and scores.
Usage near the budget
83 % of the month's budget with three days left. Headline numbers, then the Pro BudgetGuard, CostExplorer, LatencyHistogram, TokenBreakdownChart, ModelRoutingFlow and UptimeStrip, separated by space and a hairline.
On a phone
Below 768 px the rail moves into a drawer, each trace stacks its numbers under the input and the span detail becomes a full screen sheet with a way back to the trace. Pass layout="mobile" to force it inside a device frame.
Empty and loading
A new project before its first trace says how to send one. While data loads, every view holds its layout with quiet placeholders.
What is inside
- The shell is the free
ChatLayout: the rail collapses to icons withCmd+B, the span detail is its resizable side panel. - Traces: every run with a status glyph and word, name, id, input, duration, tokens, cost and age. Filter to failed or running runs, search ids, inputs, users and releases, and move through rows with the arrow keys.
- A trace: the input, status, user and release, then the Pro
TraceWaterfallwith depth control. Selecting a span opens the ProSpanDetailbeside it, with copy as cURL. - Usage: requests, latency, failure rate and tokens, the budget with pause at cap, spend by model, user or feature, latency with a drill down that opens traces, tokens by kind, routing outcomes and 90 days of uptime.
- Errors: the Pro
ErrorGroupswith trends, samples that open their trace and Resolve, above the ProLogTailfollowing the worker log. - Alerts: rules with their state, reading and channel, firing first. Each one mutes from its switch, a firing rule opens its traces, and the last week's incidents show how long each lasted. While a rule fires, a banner under the header says so on every other view.
- Spend this month at the foot of the rail, amber from 80 % and red at the cap, and every shortcut in
KeyboardShortcuts.
Props
| Prop | Type | Notes |
|---|---|---|
project, environment | string | At the top of the rail |
traces | ObsTrace[] | Newest first, each with its spans. live grows on the clock |
usage | ObsUsageData | Costs, latency samples, tokens, routing, uptime, budget and totals |
errorGroups | ErrorGroup[] | Samples link to traces by id |
logs, logStatus | LogLine[], LogStreamStatus | The log under the errors |
alerts, incidents | ObsAlert[], ObsIncident[] | Rules and their history |
defaultView, defaultTraceId, defaultSpanId, defaultFilter | Where the app opens | |
defaultPauseAtCap | boolean | Pause agents at the budget cap. Default true |
loading | boolean | Every view shows its loading state |
account | { name, plan } | The account menu at the foot of the rail |
now | number | Reference time for ages and durations |
layout | "auto" | "desktop" | "mobile" | Force the phone layout inside a device frame |
Keyboard
| Key | Action |
|---|---|
Cmd+B or Ctrl+B | Collapse or expand the rail |
Cmd+/ or Ctrl+/ | Every shortcut, grouped by area |
Up, Down, Enter | Move through traces and open one |
Up, Down, Left, Right | In the waterfall: move between spans, fold and unfold |
Enter | Open the span in the side panel |
Escape | Close the span, then back to the traces |
Accessibility
- Landmarks from the layout, a skip link, a named navigation with
aria-current, and one heading level 1 per view. - Status never rests on color: every trace, rule and incident pairs its hue with a glyph and a word.
- Each trace row is one button whose name reads the trace, its status, duration and age.
- The firing banner is a status region. Resolving a group, muting a rule and changing the budget switch are announced politely.
- Loading regions are busy status regions with a name, so a screen reader hears what is on its way.
Motion
- The span panel slides 16 px on the panel curve, a sheet on phones. A live waterfall grows on its clock.
- Moving between views, traces and the list is instant: it is used all day and from the keyboard.
- Reduced motion is handled by each composed part.