← all branches

fix/ph-insights

needs attentionviewing older commit
f9ad657 · incrementalpre-PRreviewed 2026-08-01 00:35 UTC0H · 1M · 2L · 1I
The branch
Purpose
Fix misleading PostHog dashboards — dead-event tiles and admin-gated funnels that showed structurally wrong metrics
Goal
Make PostHog activation and job-health dashboards read correctly without misleading the team
Sub-goals
  • Remove permanently-empty dashboard tiles for dead cfe_job.* event insights
  • Add member-level time-to-value funnel that excludes the admin-only credentials step
  • Rename funnels to clarify org-level vs member-level semantics
  • Add BAT-286 staleness warning to the dead-event block
The changes (whole branch)
What
Removed 2 dead-event tiles from platform_health dashboard layout. Added time_to_value_funnel_no_credentials insight (3-step, excl. credentials). Extracted shared funnel config into locals. Renamed time_to_value_funnel and org_activation_funnel to clarify scope.
Why
Four dashboard tiles were permanently empty — cfe_job.* terminal events never fired in the Lambda pipeline. The time-to-value funnel gated on credentials.saved (admin-only, ~10 people/90d), capping step-2 at ~8% BY CONSTRUCTION regardless of actual activation health.
Areas
infra/posthog/dashboards.tf+69infra/posthog/insights.tf+14624
Blast
PostHog IaC only — 2 files, +152/-33. No application code, no DB, no API changes.
posthog-iac
CI· No CI checks available for pre-PR branchCodeRabbit· No .coderabbit.yaml in repocorrectnesssecurityconventionstestsimprovement· 1 medium, 2 low, 1 info

Findings · 4

improvement4

medium

Staleness comment has no machine-enforceable hook — it will silently rot

infra/posthog/insights.tf

The '⚠ THIS BLOCK GOES STALE THE DAY BAT-286 LANDS' comment is a purely human reminder with no enforcement mechanism. When BAT-286 lands the reviewer must remember to grep for it. Consider a Terraform lifecycle precondition with BAT-286 in the error_message, or extract the two dead-event resources into insights_dead_events.tf so deletion is a file-drop.

low

org_activation_funnel repeats 30-day window inline — undocumented coincidence

infra/posthog/insights.tf

The inline funnelWindowInterval = 30 in org_activation_funnel is now an undocumented coincidence with the shared locals. A brief comment clarifying it is intentionally independent would prevent a future reviewer from incorrectly pulling it onto the shared local.

low

Alert-only guard comment lives only in dashboards.tf, not on the resource definition

infra/posthog/insights.tf

Already addressed — the job_success_rate and job_failure_by_error resources already carry '# Detached: kept as a resource for alerts.tf only.' at their definition sites. No action required.

info

time_to_value_date_range local adds indirection for a trivial single-field value

infra/posthog/insights.tf

time_to_value_funnels_filter (3 fields) justifies extraction. time_to_value_date_range ({ date_from = "-90d" }) is a single field — the indirection adds minimal DRY value. Consider inlining it or adding a comment explaining the 90-day window is a shared policy.

History · 5 commits

  1. ba4f438safeincremental0H · 0M · 1L2026-08-01 00:54
  2. f9ad657needs attentionincremental0H · 1M · 2L2026-08-01 00:35current
  3. 1475bfbsafeincremental0H · 0M · 0L2026-07-31 20:34
  4. 6b58b01needs attentionfull0H · 3M · 5L2026-07-31 18:10
  5. a97e2f0needs attentionfull1H · 2M · 2L2026-07-31 17:23