Add --prom-bearer-file, --prom-basic-auth-user/--prom-basic-auth-password-file,
--prom-ca-file and repeatable --prom-header to grom run, backed by a new
prom.NewWithOptions. Secrets are read from files only and re-read per request.
With no new flags the existing prom.New path is used unchanged.
Standard library only; go.mod is unchanged.
Refs #2
Grafana's mascot and AI helper are both named Grot
(grafana.com/grot) — a name collision flagged on the r/grafana
launch thread. grom (Polish: thunder) keeps the short Slavic name
without squatting on Grafana's brand.
Renames the Go module, cmd dir, binary, brew cask, docs, examples,
and dev docs. Old repo URL redirects; module path is new as of
v0.2.0.
- config: 'sparkline: true' on stat widgets routes their queries through
query_range, so the existing value+trend rendering receives history.
- grafana import: stat graphMode maps 1:1 — absent/'area' (Grafana default)
→ sparkline on, 'none' → off.
- examples/pilot.yaml row 1 reworked: success rate, tokens, cost/issue
(zero-denominator guarded), prs/session — all with trend bands.
- demo gallery: all four row-1 cards carry the subdued band.
Expressions like sum(a)/sum(b) return +Inf when the denominator is 0.
Instant queries now drop non-finite values (no data, not a $+Inf stat);
range queries normalize ±Inf to NaN so charts render a gap instead of a
broken y-scale.
A quiet centered panel listing the keybindings, btop-style. The overlay is
modal — any key dismisses it (quit still works) — and esc now closes the
zoomed panel, matching what fingers expect.
The header (title · clock · theme · range · stale list) had no width bound; a
long stale-widget list on a narrow terminal would wrap and shift the entire
grid below it by a line.
The live dashboard's charts collapsed into solid blocks jammed against the right
edge, unlike the demo gallery's airy full-width braille. Two causes:
- prom.go QueryRange dropped NaN samples, and scaleToDots/resampleCols
right-align when points < columns — so a sparse series (p95: ~60/90 buckets
NaN) lost its time axis and got shoved right as a filled block. Now QueryRange
keeps NaN positionally; the braille scalers render NaN as a gap (height 0) and
ignore it in min/max; Series.Last() and TimeSeries.collect() skip NaN. Sparse
ranges now render at their true timestamps with gaps, and stacked multi-series
stay index-aligned. Regression tests in render + prom.
- examples/pilot.yaml was thin and used sparse query shapes. Rebuilt to mirror
the demo: 24-col gridPos layout (4 stats / gauge + bar gauge / two charts),
tokens-by-direction as a bar gauge, and always-defined cumulative/rate charts.
go test -race and golangci-lint clean; demo gallery unchanged.
Phase 5 of the v0.1 MVP — reproduce a Grafana dashboard in the terminal.
- internal/grafana: Import/Convert map a Grafana export (bare or {"dashboard":{}}
wrapped) to a normalized config.Dashboard + warnings. stat/gauge/bargauge/
timeseries map 1:1; fieldConfig defaults (unit/decimals/min/max/thresholds),
stacking, reduceOptions, and targets (expr/legendFormat/instant) carry over;
time.from now-<dur> -> range, refresh -> refresh. Row panels drop but promote
their children; unsupported types become a placeholder in their grid slot with
a warning.
- config: TypePlaceholder (query-less) + exported Dashboard.Normalize so the
importer runs the loader's validation/defaults.
- widget: Placeholder panel ("unsupported: <type>").
- app/grid: GridLayout now honors 24-col gridPos (scale to termW, group by
Grafana row) when present, else auto-flows; composeGrid is Y-grouped, X-sorted,
and gap-aware so tiled dashboards reproduce faithfully.
- cli: run --grafana-json <file>; new `grot import <file> [--check]`.
Verified: `run --grafana-json pilot-dashboard.json --once` @ :9093 reproduces the
Grafana 4x4 layout with correct titles/units/thresholds/charts; synthetic fixture
covers gauge/bargauge/row-promotion/placeholder. Golden tests (real + synthetic +
wrapped + parseNowRange) + gridPos layout test; go test -race and lint clean.
Phase 4 of the v0.1 MVP. Consolidates layout/fetch/render into internal/app and
adds the interactive TUI; cmd/grot/run.go is now thin CLI wiring.
- grid.go: Rect + GridLayout (auto-flow, absolute cells, reflow breakpoints
<80/80-139/>=140) + focusMove (overlap-gated geometric hjkl).
- fetch.go: FetchWidget/useRange/FetchAll moved out of run.go.
- render.go: header, grid compositor, StaticFrame, and safeRender (never renders
a widget below its MinSize).
- model.go: Bubble Tea Model + RunTUI. tick -> batched per-widget fetch Cmds with
an in-flight guard so slow queries never block Update or stack; keys for hjkl
focus, Enter zoom, +/- range presets, r refresh, t theme, q quit; WindowSizeMsg
reflow; vertical scroll; widget-local errors keep the grid intact.
- run.go: default launches the TUI; --once renders one static frame.
Fix: an aggressive resize could lay a widget out below its chrome, underflowing
width math to a negative strings.Repeat count and panicking in TruncateVisual.
TruncateVisual/Center/PadOrTruncate now clamp non-positive widths, and safeRender
gates widget sizes — "live resize never breaks the grid".
Verified: full interactive TUI against live Prometheus (real PTY) renders all
widgets and handles all keys without panic; 12 model tests + grid/step tests;
go test -race and golangci-lint clean.
Phase 2 + Phase 3 of the v0.1 MVP.
Phase 2 — instant queries + native config:
- internal/datasource: Datasource interface at the consumer boundary
(QueryInstant/QueryRange) with Instant/Range request types.
- internal/datasource/prom: client_golang-backed impl; {{label}} legend
expansion; NaN samples dropped.
- internal/config: canonical Dashboard/WidgetSpec model + strict YAML loader
(KnownFields, validation, defaults).
- internal/app: BuildWidget spec→widget factory.
- cmd/grot run: --config/--prom/--theme/--watch; per-widget ctx timeout so one
slow/failing query never breaks the grid.
Phase 3 — query_range + braille timeseries:
- internal/app/step: StepFor(range, chartWidth) — chartWidth×2 dots → step
rounded up a clean ladder, 10s floor; sample count never exceeds the dot
budget (table + invariant tests).
- cmd/grot run: layout planned once per tick so fetch (step sizing) and draw
share widths; timeseries routed through QueryRange; --ascii block fallback.
- examples/pilot.yaml: p95 execution + stacked tokens-by-model timeseries.
Known gap: range NaN points are dropped rather than
kept as positional gaps, which collapses the time axis for sparse series and
would misalign stacked multi-series. To be addressed before stacked ships.