feat/mrr-tables
needs attentionviewing older commit7bc9dd8 · incrementalpre-PRreviewed 2026-08-10 17:59 UTC1H · 8M · 6L · 3I- Purpose
- Establish a correct MRR taxonomy in PostHog analytics: replace 'subs vs descargas' with 'Monitoreo (recurrente) vs Descarga única', applied consistently across all MRR insights and the interactive pivot.
- Goal
- Unified MRR taxonomy across PostHog dashboards aligned with the pivot script model
- Sub-goals
- SG-1: Remove mrr_subscription_based insight (framed Neto/Pilgrim's as a separate product incorrectly)
- SG-2: Update mrr_coverage_gap to use recurrence-based split via proportional allocation
- SG-3: Add mrr_monthly_base shared local CTE for 6-month trend data
- SG-4: Add mrr_tendencia_producto and mrr_tendencia_plan monthly trend line insights
- What
- Removed mrr_subscription_based insight; added mrr_monthly_base shared CTE local; updated mrr_coverage_gap SQL to split by recurrence; added two new monthly trend line insights (by product, by plan); adjusted dashboard layout.
- Why
- The old model treated Neto/Pilgrim's (billingUnit=subscription) as a distinct product, when they are just monitored RPUs billed recurringly — the same action as credit-account monitored RPUs. The new model uses recurrence (monitored vs one-time download) as the product axis, consistently with the interactive pivot script.
- Areas
- infra/posthog/insights.tf+160−368infra/posthog/dashboards.tf+14−27
- Blast
- 2 files, +174/−395; PostHog analytics IaC only — no app code, no migrations, no API changes
Findings · 16
correctness5
mon CTE is a current snapshot — misclassifies historical monitored/one-time downloads
infra/posthog/insights.tf
The mon CTE selects CURRENT monitored RPUs; downloads on since-cancelled RPUs get wrongly classified. Structural schema limitation.
subs CTE undercounts historical months — hard-deleted cancelled subscriptions missing
infra/posthog/insights.tf
mrr_coverage_gap medido fallback (t=0): full org MRR assigned to Descarga única for dormant active orgs
infra/posthog/insights.tf
credit CTE reprices historical downloads at current org plan rate — distorts past MRR in trend lines
infra/posthog/insights.tf
Dashboard y=5 row: right half empty after removing mrr_subscription_based
infra/posthog/dashboards.tf
security2
Company MRR constants hard-coded in Terraform locals (pre-existing)
infra/posthog/insights.tf
Org names and plan slugs as chart series labels in internal analytics dashboard
infra/posthog/insights.tf
conventions2
mrr_monthly_base should be d3_mrr_monthly_base — breaks the d3_ prefix convention
infra/posthog/insights.tf
chartSettings uses padded alignment — terraform fmt will normalize
infra/posthog/insights.tf
tests2
Trend lines vs Coverage Gap model divergence undocumented for chart readers
infra/posthog/insights.tf
terraform state rm needed if mrr_subscription_based is in Terraform state before apply
infra/posthog/insights.tf
improvement4
mon CTE duplicated in mrr_monthly_base and mrr_coverage_gap — extract to shared local
infra/posthog/insights.tf
mrr_tendencia_producto and mrr_tendencia_plan are structurally identical — for_each candidate
infra/posthog/insights.tf
Terminal CTE alias f is opaque in a shared local
infra/posthog/insights.tf
range(6) includes current partial month — 'last 6 months' comment is misleading
infra/posthog/insights.tf
seo1
SEO lens skipped — no apps/web/** files in diff