feat(selfhost): add PostHog error tracking as a parallel sink alongside Sentry#8607
Conversation
…de Sentry Adds src/selfhost/posthog.ts, mirroring sentry.ts's capture surface (capturePostHogError, capturePostHogReviewFailure, structured-log forwarding, cron-monitor heartbeats) and wires it into every existing Sentry call site across the self-host server, queues, and monitors. Extracts the shared redaction primitives both sinks now depend on into src/selfhost/redaction-scrub.ts so the security-critical scrubbing logic isn't duplicated. Runs opt-in and fully parallel with Sentry per the epic's gated decommission plan (#8298) -- Sentry is untouched here. Closes #8287
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
loopover-ui | a7b49b2 | Commit Preview URL Branch Preview URL |
Jul 25 2026, 07:07 AM |
Bundle ReportChanges will increase total bundle size by 5.92kB (0.08%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: loopover-uiAssets Changed:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8607 +/- ##
==========================================
- Coverage 92.54% 92.00% -0.55%
==========================================
Files 796 798 +2
Lines 79690 79850 +160
Branches 24066 24120 +54
==========================================
- Hits 73749 73463 -286
- Misses 4803 5311 +508
+ Partials 1138 1076 -62
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-25 07:23:36 UTC
Review summary Nits — 6 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. Visual preview
Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy. Scroll preview
A short scroll-through clip (desktop) — click either thumbnail to open the full animation. Evidence for scroll-linked behavior a single screenshot can't show. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|


Summary
src/selfhost/posthog.tsas a full parallel error-tracking sink alongsidesrc/selfhost/sentry.ts, exposing the same capture surface:capturePostHogError,capturePostHogReviewFailure, structured-log forwarding, and cron-monitor heartbeats (orb_monitor_heartbeat, since PostHog has no native check-in product).src/selfhost/redaction-scrub.ts(zero behavior change to Sentry — its 82 existing tests pass unchanged against the extracted version).withBothMonitorshelper), review-orchestration failures, and agent-action-executor failures.POSTHOG_API_KEY→ no-op,posthog-nodeonly dynamically imported when configured. Sentry is untouched; both sinks run simultaneously until the epic's gated decommission (Sentry decommission: gated cutover checklist across all six surfaces #8298) says otherwise.self-hosting-operations.mdx, plus a drift-guard test mirroring the existing Sentry one.Closes #8287
Test plan
npm run typecheckcleannpx vitest run test/unit/selfhost-posthog.test.ts test/unit/selfhost-sentry.test.ts test/unit/docs-selfhost-posthog-observability.test.ts test/unit/docs-selfhost-sentry-observability.test.ts— 151/151 passingnpm run test:ci— full suite green (one pre-existing, unrelated failure confirmed present on main independent of this branch:mcp-cli-profiles.test.ts's changelog-JSON test, tracked separately)npm run selfhost:env-reference:checkcleannpm run cf-typegen:checkclean