Repository navigation
feat(dashboards): chart Google Cloud metrics live with PromQL - #1480
Open
JeremyFunk wants to merge 38 commits into
Open
JeremyFunk wants to merge 38 commits into
JeremyFunk wants to merge 38 commits into
Maple Review Bot / Maple / review
completed
Oct 16, 2026 in 1m 34s
Confidence 2/10 · 5 issues to address
🔴 Confidence 2/10 · do not merge
Five earlier warnings (share guard, empty projects, stat reduction, All splicing, project_id on shares) are unchanged at this head and none has a test.
quality 50/100 · 5 warnings · tests partial · risk high · 3/3 new units observable
Adds a live Google Cloud PromQL source for dashboard widgets across the editor, the share resolver and the v2 API. The five earlier warnings all still stand at this head; the open WarehouseInvalidInputError is a breakdown query this change neither causes nor fixes.
PromQlWidgetDataSource(kind: "promql") joins the v3 and v2 data sourcestoWidgetRequestlowers it to thegcp_promqlendpoint under apromqlparam key- Share links run the stored PromQL and guard referenced variables to the free-text charset
- A queryless tile is
promql_query_empty, rendering "No query yet"
Still open from earlier reviews
- 🟠 Warning · F1 ·
promQlQueriesskips sparkline sources, so a variable can escape the guard ·apps/api/src/routes/v2/share.http.ts:305 - 🟠 Warning · F2 ·
dataSourcePromQlforwards an emptyprojectslist every read rejects ·packages/widgets/src/dashboard/access.ts:187 - 🟠 Warning · F3 · Stat/gauge PromQL tiles reduce a
valuefield the rows never carry ·apps/web/src/components/dashboard-builder/config/widget-query-builder-page.tsx:172 - 🟠 Warning · F4 · An All selection splices a bare
a\|balternation into the matcher ·packages/query-engine/src/dashboard-variables/interpolate.ts:106 - 🟠 Warning · F5 · Shared PromQL rows carry
project_idkeys an unauthenticated viewer can read ·packages/backend/src/services/dashboards/DashboardWidgetDataService.ts:444
Production impact
Open errors in the changed files
| Issue | Service | Occurrences | File |
|---|---|---|---|
| @maple/web/errors/WarehouseInvalidInputError | maple-web | 9 | 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 |
|---|---|---|
packages/backend/src/services/dashboards/DashboardWidgetDataService.ts |
2 | DashboardWidgetDataService.resolve 2/day, 0.0% err |
Telemetry this change adds and removes (3)
- ➕ span name
Integrations.getGcpPromQlChart·apps/web/src/api/warehouse/gcp-promql.ts:24 - ➕ span name
Integrations.getGcpMetricSearch·apps/web/src/api/warehouse/gcp-promql.ts:44 - ➕ span name
Integrations.getGcpMetricDescriptor·apps/web/src/api/warehouse/gcp-promql.ts:58
What was checked
- A 4,000-character query, a 60 s step floor and the 11,000-point cap are enforced on the range request (
packages/query-engine/src/gcp-promql.ts:24,packages/domain/src/http/gcp-promql.ts:79) - Shared documents drop
query,projectsandlegendbefore render (packages/widgets/src/dashboard/redact.ts:90) - The new
gcp_promqlserver function andGcpPromQlService.queryRangeboth run under namedEffect.fnspans
Observability coverage: 3 of 3 changes observable
| Change | Kind | Observable | Evidence |
|---|---|---|---|
PromQL widget read from the browser server function getGcpPromQlChart (apps/web/src/api/warehouse/gcp-promql.ts) |
client | yes | Effect.fn("Integrations.getGcpPromQlChart") at line 24, wrapped in runWarehouseQuery |
PromQL read on the share/batch path in DashboardWidgetDataService.resolve |
server | yes | Effect.fn("DashboardWidgetDataService.resolve") with Effect.annotateCurrentSpan({ orgId, "maple.widget.id": … }) at line 249 |
Google Cloud Monitoring range query reached through GcpPromQlService.queryRange |
client | yes | Effect.fn("GcpPromQlService.queryRange") with annotateCurrentSpan({ orgId }) (service added by the base branch #1477) |
cea3674 · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.
Loading