Repository navigation
feat(billing): daily profile usage from service_usage - #2681
Merged
Merged
Maple Review Bot / Maple / review
succeeded
Nov 16, 2026 in 2m 5s
Confidence 10/10 · No issues found
🟢 Confidence 10/10 · safe to merge. No defect found; the new view, the v59 to v60 step and the fallback are each pinned by a test. The one-shot forwardQuery is the only live risk.
no findings · tests covered · risk high · 1/1 new units observable
Adds estimated continuous-profiling volume to the billing page's daily chart: a service_usage_profiles_mv over profiles, migration 0068 recreating all seven service_usage views, and the read path with a fallback for clusters that lack the columns. Safe to merge once the Tinybird preview passes.
service_usage_profiles_mvcounts profile stack rows and estimates bytes per org, service and hourdailySignalVolumeQuerysumsProfileSizeBytes;DailySpendServicemaps it toprofilesGB- Migration 0068 adds both columns and recreates every
service_usageview - A cluster without the columns re-runs the query reading 0 profile bytes
Before merge
- Migration · Check it is safe on production data and with the code still deployed ·
packages/domain/src/clickhouse/migrations/0068_service_usage_profiles.ts - Warehouse · Once the 0068 deploy is live, restore
forwardQuery: SELECT *inpackages/domain/src/tinybird/datasources.ts, perdocs/warehouse-rollups.md·packages/domain/src/tinybird/datasources.ts - Manual · Deploy with the full
previewlabel, notpreview:web: this changes Tinybird datasources and views
Fixed since the last review
- ✅
F1 ·count() AS ProfileCountcounts stack rows, not profiles
What was checked
- All seven
service_usageviews emit the two new columns last, matching the target's column order (materializations.ts:174-384,materialized-projection-order.test.ts:118-124) local-schema-v60.sqlis byte-identical tolocal-schema.sql(diff), and the step idlocal-0059-to-0060-service-usage-profilesmatches the new chDB test- The fallback SQL names no profile column and decodes
profileBytes: 0, pinned bybilling-usage.test.ts:76-85
Observability coverage: 1 of 1 changes observable
| Change | Kind | Observable | Evidence |
|---|---|---|---|
| billing daily signal volume read (profiles variant and its fallback) | outbound warehouse query | yes | WarehouseQueryService.compiledQuery with context billingDailySignalVolume (DailySpendService.ts:74-84) |
210faa8 · Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.
Loading