← all branches

feat/mrr-d3

safeviewing older commit
9c481ad · incrementalpre-PRreviewed 2026-08-07 17:23 UTC0H · 0M · 1L · 2I
The branch
Purpose
Add MRR cross-reference analytics to PostHog — measured on-platform MRR vs off-platform reference vs total company MRR (coverage gap view).
Goal
Four D3 insights (BAT-308–311): mrr_by_product (per-org detail), mrr_by_product_summary (rollup), usage_by_product_month (MoM temporal), mrr_coverage_gap (measured vs total, gap = residual). Product derivation from credit_transactions + subscriptions.
Sub-goals
  • D3.1 (BAT-309) mrr_by_product — per-org MRR × product detail table
  • D3.2a (BAT-310) mrr_by_product_summary — rollup by product
  • D3.2b (BAT-310) usage_by_product_month — MoM temporal use
  • D3.3 (BAT-311) mrr_coverage_gap — measured + off-platform ref vs company total
  • Dashboard layout — 4 D3 tiles added to revenue_mrr dashboard
The changes (whole branch)
What
Trim mrr_coverage_gap description from 498 → 376 chars to fix PostHog 400-char API limit. No SQL, no logic, no structural changes — metadata-only.
Why
PostHog API returns HTTP 400 when insight description exceeds 400 chars; terraform apply was failing on this resource.
Areas
infra/posthog/insights.tf+3040infra/posthog/dashboards.tf+170
Blast
2 files, +321/-0 across infra/posthog. PostHog-only — no platform code, no database, no API, no UI.
Prior open finding (cf2ce902): D3.3 payment_status double-count latent — not addressed in this commit (description-only change)
ci· no open PR — CI status not availablecoderabbit· no .coderabbit.yaml in repo

Findings · 3

correctness2

low

Dropped `d3_offplatform_mrr` variable name — readers must grep .tf to find what to refresh

infra/posthog/insights.tf:1485

Old text named the Terraform local explicitly: 'Constantes finance en locals (d3_offplatform_mrr), se refrescan a mano.' New text says only 'Constantes en locals (refresco manual)'. A reader who sees 'refresco manual' in the PostHog UI now has to grep the .tf file to find what to edit. Fix: 'Constantes en locals.d3_offplatform_mrr (manual).' fits within 400 chars.

info

Commit message cites 431 chars for old description; actual was 498

infra/posthog/insights.tf:1485

Minor inaccuracy in commit narrative only. New description is 376 chars — safely under the 400-char limit regardless. No impact on resource correctness.

improvement1

info

Consider `locals{}` for long descriptions to avoid future 400-char scrambles

infra/posthog/insights.tf

The file already uses locals for SQL CTEs. Applying the same pattern to long descriptions (e.g. `mrr_coverage_gap_description = "..."` in locals) uncaps HCL string length. Not urgent at 376 chars, but worth reaching for if a description approaches 350 chars again.

History · 5 commits

  1. bdb56d2needs attentionincremental0H · 0M · 3L2026-08-07 18:03
  2. 742255eneeds attentionincremental1H · 4M · 5L2026-08-07 17:50
  3. 9c481adsafeincremental0H · 0M · 1L2026-08-07 17:23current
  4. cf2ce90needs attentionincremental0H · 1M · 2L2026-08-07 17:14
  5. fb7f6ffneeds attentionfull0H · 6M · 8L2026-08-07 16:46