Thanks to visit codestin.com
Credit goes to github.com

Skip to content

docs(examples/monitoring): add chatd lifecycle Grafana dashboard - #28975

Draft
jscottmiller wants to merge 1 commit into
scott/chatd-stages/7-turn-accountingfrom
scott/chatd-stages/8-dashboard
Draft

docs(examples/monitoring): add chatd lifecycle Grafana dashboard#28975
jscottmiller wants to merge 1 commit into
scott/chatd-stages/7-turn-accountingfrom
scott/chatd-stages/8-dashboard

Conversation

@jscottmiller

@jscottmiller jscottmiller commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Grafana dashboard for the chatd lifecycle metrics at examples/monitoring/dashboards/grafana/chatd-lifecycle/, with a README documenting every panel.

Rows, each with a $stat selector (mean, p50, p90, p95, p99): a stat panel showing the --chat-stage-metrics level from coderd_chatd_stage_metrics_level; the turn time partition (per-model mix, seconds per turn by category, unattributed time); one row per stage tree level with duration per occurrence for the stages observed at basic (the server default is off, so the dashboard needs --chat-stage-metrics=basic or full on the coderd replicas); throughput, TTFT, and background provider calls. Each level also has a collapsed row titled (full level only: --chat-stage-metrics=full) holding the per-turn panels (seconds per turn, occurrences per turn, share of turn), the per-turn category share, and the stages observed only at full (generation_step, prepare, thinking, compaction). The label schema is the same at every level, so those panels read "No data" rather than erroring at basic. Variables: $datasource, $stat, $chat_kind, $model. Every division guards its denominator and every histogram_quantile keeps le.

The README documents the levels with an annotated stage tree, the series cost per level, example alert rules on the round bucket edges, and a scrape-time relabel snippet for alert-only deployments.

An earlier revision had an aggregate flamegraph and hierarchy table row built from a 15-stage label_replace expression over [$__range]. It was removed: the query loaded every bucket series for the whole dashboard range on each refresh, and because Prometheus cannot compute self time for overlapping stages the flamegraph shape was misleading. The per-level rows carry the same per-stage data with bounded lookback.

Verified against a live dev deployment (Grafana 12.1, Prometheus, Tempo) at both basic and full: every expanded panel populates at basic with 326 series after three turns on one model, and the collapsed rows populate at full (1,132 series after six turns).


Part of the chatd lifecycle observability stack: 1 extract step · 2 stage tracer · 3 stream stages · 4 provider attempts · 5 turn span · 6 capacity wait · 7 turn accounting · 8 dashboard. Supersedes the experimental branch in #28741.

🤖 This PR was generated by Coder Agents on behalf of @jscottmiller.

Add a Grafana dashboard that plots the chatd stage histogram and the
turn-end rollups one tree level at a time with a selectable summary
statistic, plus summary panels for the chat pipeline and the per-turn
partition of turn wall time. The README documents the stage hierarchy
by tree level, the dashboard dimensions, each panel group, and setup.

Rows that need only the basic stage metrics level are expanded by
default; the per-turn distribution panels and the stages observed only
at the full level sit in collapsed rows named for the level. A stat
panel reports the level from coderd_chatd_stage_metrics_level. The
README adds a metric levels section with series cost, example alert
rules on the round bucket edges, and a scrape-time relabel snippet for
alert-only deployments.
@jscottmiller
jscottmiller force-pushed the scott/chatd-stages/7-turn-accounting branch from 2eec66e to 948b3e7 Compare September 11, 2026 19:17
@jscottmiller
jscottmiller force-pushed the scott/chatd-stages/8-dashboard branch from 098e14d to d52393b Compare September 11, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

experimental Changes that might not necessarily be merged, until its approved to proceed with.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant