40 lines
1.8 KiB
Markdown
40 lines
1.8 KiB
Markdown
# 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_default` creating a brand-new `Default` profile (not on every
|
|
startup — only when the profile itself is newly created), seed one
|
|
`Dashboard` with two panels:
|
|
- Line chart: log message count over time, split into "contains `error`" vs.
|
|
"does not contain `error`" series.
|
|
- Pie chart: same split, as a ratio/total-count breakdown.
|
|
- Express both panels as PromQL-style queries against a counter
|
|
([022](022-metrics-counters-rethink.md)) — 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 `Default`
|
|
profile that already has one dashboard containing the line and pie panels
|
|
described above, without any user action.
|
|
- Restarting with an already-existing `Default` profile 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](022-metrics-counters-rethink.md) (defines what a
|
|
"count of matching logs" counter/query looks like).
|