Skip to content

PostHog error tracking + release/sourcemap pipeline for discovery-index (off the shared metagraphed Sentry project) #8289

Description

@JSONbored

Part of epic #8286 (Phase 1 — Errors).

Current state

packages/discovery-index/src/sentry.ts (#4934) — error tracking for the hosted discovery-index service (a Node service in a Cloudflare Container at discovery.loopover.ai, so posthog-node is usable here, unlike a Workers isolate). Two things make this surface special:

  1. It currently reports into the shared metagraphed Sentry project (its own header documents this) — there was no loopover-owned project to point at when it shipped. Migrating it gives it a loopover-owned home for the first time and removes a cross-project entanglement ahead of metagraphed's own Sentry sunset (Sentry decommission (repo side): gated cutover checklist metagraphed#7766).
  2. It has a full release/sourcemap pipeline: src/upload-sourcemaps.ts (@sentry/cli), scripts/validate-sentry-release.mjs, scripts/validate-sourcemaps.mjs — release + sourcemap upload are part of its deploy, and the validators gate drift.

Deliverables

  • Swap the capture sink to PostHog $exception via posthog-node, preserving the module's existing shape: field-name + value-pattern redaction (SECRET_FIELD/SECRET_VALUE), fingerprints, levels, the DISCOVERY_INDEX_SENTRY_TAG_KEYS tag allowlist (renamed accordingly).
  • Replace the @sentry/cli release/sourcemap pipeline with the PostHog equivalent (posthog-cli sourcemap inject + upload, release tagging), and update both validator scripts to validate the PostHog artifacts instead.
  • Point at the loopover-owned project (Provision a loopover-owned Posthog project for the hosted fleet #7875's key, injected as this service's secret — coordinate naming with Wire hosted control-plane + tenant containers to report to the central PostHog project (implements #4934) #7876's control-plane conventions).
  • Sentry path stays wired in parallel until the decommission gate.
  • Tests: capture/redaction parity with the existing sentry tests; validator scripts against a fixture build.

Boundaries

  • review-enrichment's identical-shaped swap is its own sub-issue (separate deploy, separate secrets).

Resources

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions