Repository navigation
feat(infra): show pod restarts and last termination reason - #1389
Confidence 8/10 · No issues found
🟢 Confidence 8/10 · likely safe to merge
The pod-restart query is pinned by the recorded SQL baseline and the folding/tone helpers by unit tests; only the collector's resource attribute itself is unverified here.
quality 100/100 · no findings · tests covered · risk medium · 2/2 new units observable
Adds podRestartsQuery, a POST /pod-restarts endpoint and pod-page UI for restarts and last termination reason. Containment is good and the SQL is pinned by the catalog baseline; safe to merge. The open WarehouseInvalidInputError in warehouse-query-atoms.ts is unrelated and untouched by this diff.
podRestartsQuerycounts window restarts as last minus first, floored at 0, and addslastTerminatedReasonPOST /pod-restartsplus apodRestartsregistry query and API handler- Pod list shows a per-pod restart marker from a second query over the visible pod names
- Pod page gains a Restarts tile and a per-container restarts table
Production impact
Open errors in the changed files
| Issue | Service | Occurrences | File |
|---|---|---|---|
| @maple/web/errors/WarehouseInvalidInputError | maple-web | 12 | apps/web/src/lib/services/atoms/warehouse-query-atoms.ts |
After this merges, Maple checks whether they stop.
Production traffic of the changed files (last 7 days)
| File | Calls/day | Busiest operations |
|---|---|---|
apps/api/src/routes/internal/query-engine.http.ts |
5 | podInfraTimeseries 5/day, 0.0% err |
packages/domain/src/http/query-engine.ts |
5 | podInfraTimeseries 5/day, 0.0% err |
What was checked
- Counter resets:
greatest(argMax - argMin, 0)cannot overcount, matching the doc at infra.ts:739 - Empty
podNamesskips the filter instead of emittingIN ()(infra.ts:783, infra.test.ts:372) ResourceAttributes[...]andargMaxper container are pinned verbatim in__sql_baseline__/catalog.sql:1467
Observability coverage: 2 of 2 changes observable
| Change | Kind | Observable | Evidence |
|---|---|---|---|
| POST /pod-restarts (query-engine HTTP API) | inbound endpoint | yes | The API registers HttpMiddleware.tracer for all HttpApi routes (apps/api/src/http/api-observability.ts:28-34); siblings like podInfraTimeseries already report ~5 calls/day in Maple. |
| podRestarts warehouse query | outbound query | yes | Runs through the shared runQuery/runWarehouseQuery path, the same one that reports podInfraTimeseries operations for maple-web. |
cd60ce5 · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.