questdb / questdb/ui

Notebooks: migrate the Metrics tab into notebooks to unify dashboards (future, not urgent)

Open
#579 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement notebooks Severity: 1 web-console
Dominant language
TypeScript
Stars
29
Forks
39
Avg merge
4d 11h
Merged PRs (30d)
4

Description

The Metrics tab (src/scenes/Editor/Metrics/, persisted as BufferType.METRICS with metricsViewState on the Buffer) is conceptually a sibling of notebooks: a grid of time-series charts persisted on a Buffer, with refresh. We want to fold Metrics into Notebooks so there's a single dashboard surface. Explicitly future / not urgent — don't block notebook work on it.

What Metrics is today
  • Buffer carries metricsViewState (src/store/buffers.ts:50-57): global dateFrom/dateTo, refreshRate (AUTO/OFF/1s/5s/10s/30s/1m), sampleBy, viewMode, and metrics: Metric[].
  • Each Metric is a predefined widget (not arbitrary SQL): metricType + tableId + color/position. The widget set lives in src/scenes/Editor/Metrics/widgets/ (WAL throughput/latency, row throughput, write amplification, avg txn size); each widget's getQuery() builds SQL from tableId + sampleBy + time range (src/scenes/Editor/Metrics/types.ts).
  • Charts render with uPlot (createUplotOptions.ts, graph.tsx) under a global date-range picker, refresh rate, and sampleBy.
How that differs from notebooks

Notebooks use echarts (src/scenes/Editor/Notebook/CellChart/), arbitrary SQL per cell, and per-cell auto-refresh (no global date range / sampleBy); metrics are MCP-invisible while notebooks are MCP-controllable.

Prerequisite

We don't have a global (notebook-level) time-range or refresh rate today — notebooks only have per-cell auto-refresh, whereas Metrics is built entirely around global date-range + refresh + sampleBy controls. When these global controls are added (notebook-level time-range, and the notebook-level refresh rate from #577), the migration becomes feasible.

Migration shape

A metrics dashboard becomes a notebook of chart cells, the predefined widgets become SQL chart cells seeded from the widget query templates, and the global date-range / refresh / sampleBy become notebook-level controls. Needs a one-time data migration of persisted metricsViewStatenotebookViewState (and BufferType.METRICSNOTEBOOK).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/scenes/Editor/Metrics/, src/store/buffers.ts, and src/scenes/Editor/Metrics/types.ts, then compare the notebook cell and chart entry points under src/scenes/Editor/Notebook/CellChart/. Confirm the notebook-level controls from #577 before planning the migration. Done means Metrics dashboards can be represented as notebook chart cells, with persisted metrics state migrated to notebook state and the old buffer type retired.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.