feat: stamp product: failproofai-oss on all PostHog events#380
Conversation
Add a `product: "failproofai-oss"` property to every PostHog event across all four telemetry channels — hooks/audit (trackHookEvent), server (trackEvent), web UI (captureClientEvent), and npm lifecycle (trackInstallEvent) — so OSS events stay distinguishable from any future hosted surface. The value lives in a single POSTHOG_PRODUCT constant in src/posthog-key.ts, reused by the three TypeScript channels. The standalone scripts/install-telemetry.mjs inlines the same literal because it runs as a raw npm-lifecycle script and can't import the TS module at install time. Adds real-payload test coverage for all four channels (two new test files for the previously-uncovered hook and install channels). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 16 minutes and 26 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (10)
Comment |
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
What
Adds a
product: "failproofai-oss"property to every PostHog event, stamped at all four telemetry choke points so no event can be missed:src/hooks/hook-telemetry.ts(trackHookEvent)failproofai auditeventslib/telemetry.ts(trackEvent)app_started, etc.lib/client-telemetry.ts(captureClientEvent)usePostHog().capture(...), client errorsscripts/install-telemetry.mjs(trackInstallEvent)How
POSTHOG_PRODUCT = "failproofai-oss"insrc/posthog-key.ts, reused by the three TypeScript channels.scripts/install-telemetry.mjsinlines the same literal (with a comment) — it runs as a raw npm-lifecycle script and can't import the TS module at install time, mirroring how it already inlines its own API key.FAILPROOFAI_TELEMETRY_DISABLED=1like all other telemetry (no behavior change there).Tests
telemetry.test.ts,client-telemetry.test.ts) to assertproduct.__tests__/hooks/hook-telemetry.test.ts,__tests__/scripts/install-telemetry.test.ts) covering the hook + install channels that previously had no payload assertions.product: "failproofai-oss"on the actual emitted body.Verified locally: lint (0 errors),
tsc --noEmitclean, 1690 unit tests pass, 298 e2e tests pass.🤖 Generated with Claude Code