Skip to content

fix(analytics): exclude test traffic and reduce replay collection - #884

Merged
zomux merged 1 commit into
developfrom
codex/posthog-usage-controls
Oct 28, 2026
Merged

zomux merged 1 commit into
developfrom
codex/posthog-usage-controls

Conversation

@zomux

@zomux zomux commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

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-eee6fc54117c filters 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.

@vercel

vercel Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openagents-workspace Ready Ready Preview Oct 28, 2026 8:05am UTC

Request Review

@zomux
zomux merged commit b599f2f into develop Oct 28, 2026
5 checks passed

This branch was successfully deployed

1 active deployment
Preview — 5c57c7e3 Deployed Oct 28, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant