fix/ph-insights
safeviewing older commit1475bfb · incrementalPR #366reviewed 2026-07-31 20:34 UTC0H · 0M · 0L · 1IThe branch
- Purpose
- Four PostHog dashboard tiles were rendering 'no matching events' in prod because they queried cfe_job.succeeded/failed/partial_success — events never emitted by the Lambda pipeline. This branch makes those fixes durable in IaC.
- Goal
- Repair or honestly document all non-rendering PostHog insight tiles on the Platform Health and Activation dashboards, and prevent terraform apply from reverting console-side emergency fixes.
- Sub-goals
- Repoint consumption funnels (file + CSV) from dead cfe_job.succeeded step 1 to live cfe_job.created
- Detach (not delete) job-health tiles that alerts.tf depends on — set dashboard_ids=[] to hide from dashboards while preserving Terraform resource IDs
- Document admin-gating distortion in time-to-value funnels with measured distinct-person counts
- Extract shared funnel window/date config into locals so TTV variants cannot drift
- Add BAT-286 staleness warning so the dead-event comment block self-destructs cleanly when the Lambda emits terminal events
The changes (whole branch)
- What
- infra/posthog/insights.tf: (1) locals block for shared TTV funnel config; (2) admin-gating comment blocks with measured data for time_to_value_funnel, time_to_value_funnel_no_credentials, and org_activation_funnel; (3) org_activation_funnel rename with '(org-level — admin steps included)' suffix; (4) data_consumption_funnel comment clarification; (5) BAT-286 staleness warning at the DEAD TERMINAL JOB EVENTS section.
- Why
- Previous loop review on 6b58b01b flagged missing admin-gating caveats and duplicated funnel config. This commit addresses those findings directly.
- Areas
- infra/posthog/insights.tf+146−24
- Blast
- 1 file, +146/-24. PostHog IaC only — no application code, no migrations, no API surface changes. Applies to PostHog project 245284 (dev) on PR open; prod only on manual release-promote.
BAT-286 required to restore full job-health metrics — tracked and documented
➖ci· pr-checks not yet returned; PR notes Terraform plan auto-applies to dev (245284) — that is the real gate➖coderabbit· no .coderabbit.yaml in repo
Findings · 1
improvement1
info
locals block placed mid-file rather than top of file
infra/posthog/insights.tf:276
Terraform convention is to group locals at the top of the file or in a dedicated locals.tf. Placing them mid-file (between monitoring_enabled and time_to_value_funnel) works correctly — locality is obvious — but a future contributor may not expect to find a locals block here. Low friction to move; defer unless the file gets a larger reorg.