Repository navigation
fix(analytics): exclude test traffic and reduce replay collection - #884
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The shared PostHog project received over 475,000 workspace creation events from reserved fixture-email domains during the September 28–October 28 billing window. Backend checkouts defaulted to the hosted project key and enabled collection. Web/Launcher autocapture and recording every session also consumed the shared allowance.
Make backend collection an explicit key + enable opt-in and reject reserved fixture domains. Load the Workspace snippet only on the production deployment/hostname outside WebDriver; preserve explicit events and SPA pageviews while disabling noisy automatic collection. Remove the duplicate workspace-open event. Launcher development/tests no longer initialize analytics; packaged builds retain explicit events without replay/autocapture. Project-wide replay sampling (10%, 10-second minimum), development URL exclusions, and automatic-capture restrictions were applied in PostHog separately. Both production backend environment files now explicitly preserve their existing project destination before this rollout. No schema changes.
Validation: 8 analytics backend tests, 9 Workspace policy tests, and 2 Launcher analytics tests pass; Workspace typecheck passes. Six old browser-recovery assertions in test_production_500_regressions.py fail identically on unchanged HEAD because they expect automatic replacement. Launcher full typecheck also fails unchanged HEAD: tsconfig.web.json omits the already imported smoke-test-panel.tsx. No unrelated changes included.
PostHog ingestion protection is also active: built-in Drop Events transformation
01a18186-ff73-0000-ffb2-eee6fc54117cfilters only distinct IDs ending in reserved example.com/example.org/example.net, localhost, .test, .invalid or .localhost email domains. The built-in test runner preserved its nonmatching example pageview and dropped a real matching fixture event; the configured filter matched about 241,000 events in the previous seven days. This affects future collection only; existing data and billing caps were preserved.