1.8 KiB
1.8 KiB
025 — Seed a default dashboard with 2 default panels
Summary
ProfileStore::ensure_default creates the Default profile with no dashboards.
The wishlist wants every fresh Default profile to come with a starter dashboard:
a line chart of "error" vs. non-"error" log volume, and a pie chart of the same
ratio.
Scope
- On
ensure_defaultcreating a brand-newDefaultprofile (not on every startup — only when the profile itself is newly created), seed oneDashboardwith two panels:- Line chart: log message count over time, split into "contains
error" vs. "does not containerror" series. - Pie chart: same split, as a ratio/total-count breakdown.
- Line chart: log message count over time, split into "contains
- Express both panels as PromQL-style queries against a counter
(022) — this likely requires an implicit
built-in "log matched regex X" counter concept (e.g. auto-declaring a metric
for
regex("error")vs. its complement), or a raw-text regex count primitive in the PromQL surface if one doesn't already exist. Decide and document which. - Seeded dashboard/panels must persist through the normal profile save path (same as any user-created dashboard) so it's editable/deletable like any other.
Acceptance criteria
- A fresh install (no existing settings/profile store) starts up with a
Defaultprofile that already has one dashboard containing the line and pie panels described above, without any user action. - Restarting with an already-existing
Defaultprofile does not re-seed or duplicate the dashboard. - The seeded panels render real data against a log stream containing a mix of "error" and non-"error" lines.
Depends on
- 022 — Metrics rethink (defines what a "count of matching logs" counter/query looks like).