Repository navigation
Maple Review Bot / Maple / review
succeeded
Nov 16, 2026 in 3m 8s
Confidence 8/10 · No issues found
🟢 Confidence 8/10 · likely safe to merge. chDB tests pin the query layer against the reference, but no test drives PromqlQueryService's successful selector read end to end.
1 note · tests partial −1 · risk high −1 · 2/2 new units observable
Runs PromQL against the metric tables: metric_catalog resolves a selector's name to stored metrics, each (table, component) becomes one warehouse query with label matchers pushed into WHERE, and the rows become series and buckets for the evaluator. Org-scoped throughout and pinned by chDB tests.
promqlSelectorQueryresolves stored names and pushes label matchers intoWHEREseriesLabels/labelValueExprbuild Prometheus labels in TypeScript and ClickHouse alikePromqlQueryServicevalidates, plans, reads the catalog once, runs selectors four-at-a-time- Histograms expand into cumulative
leseries; delta sums accumulate into counters
Still open from earlier reviews
- 🔵 Note · F1 ·
MAX_METRICS_PER_SELECTORcounts one histogram as three metrics ·packages/backend/src/services/promql/PromqlQueryService.ts:131
Production impact
Telemetry this change adds and removes (3)
- ➕ span name
PromqlQueryService.readCatalog·packages/backend/src/services/promql/PromqlQueryService.ts:100 - ➕ span name
PromqlQueryService.readSelector·packages/backend/src/services/promql/PromqlQueryService.ts:122 - ➕ span name
PromqlQueryService.query·packages/backend/src/services/promql/PromqlQueryService.ts:163
What was checked
- Every selector and catalog query filters
OrgId(ch/queries/promql.ts:123,:366) - All four metric tables carry the columns the scan reads (
Flags,Value,Count,ExplicitBounds) planRequestsalready extends the scan start by the selector window (engine/plan.ts:91)
Observability coverage: 2 of 2 changes observable
| Change | Kind | Observable | Evidence |
|---|---|---|---|
| PromqlQueryService.query / readSelector | service | yes | Effect.fn named spans plus maple.promql.* attributes; selector queries run through compiledQuery({ context: "promqlSelector" }) |
| catalog read from metric_catalog | warehouse query | yes | compiledQuery(..., { profile: "discovery", context: "promqlCatalog" }) |
5c23298 · Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.
Loading