Skip to content

feat(billing): daily profile usage from service_usage - #2681

Merged
Makisuo merged 2 commits into
mainfrom
profiles-daily-usage
Nov 16, 2026
Merged

Makisuo merged 2 commits into
mainfrom
profiles-daily-usage

fix(warehouse): every service_usage view emits the profile columns, r…

210faa8
Select commit
Loading
Failed to load commit list.
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_mv counts profile stack rows and estimates bytes per org, service and hour
  • dailySignalVolumeQuery sums ProfileSizeBytes; DailySpendService maps it to profilesGB
  • Migration 0068 adds both columns and recreates every service_usage view
  • A cluster without the columns re-runs the query reading 0 profile bytes

Before merge

Fixed since the last review

  • ✅ F1 · count() AS ProfileCount counts stack rows, not profiles
What was checked
  • All seven service_usage views 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.sql is byte-identical to local-schema.sql (diff), and the step id local-0059-to-0060-service-usage-profiles matches the new chDB test
  • The fallback SQL names no profile column and decodes profileBytes: 0, pinned by billing-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.