Skip to content

chore: add Sentry crash reporting alongside PostHog analytics - #5

Merged
blimmer merged 2 commits into
mainfrom
chore/sentry-crash-reporting
May 25, 2026
Merged

chore: add Sentry crash reporting alongside PostHog analytics#5
blimmer merged 2 commits into
mainfrom
chore/sentry-crash-reporting

Conversation

@blimmer

@blimmer blimmer commented May 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds opt-in Sentry crash reporting for unexpected errors, complementing the existing PostHog product analytics. Telemetry credentials (Sentry DSN, PostHog key/host) move out of source into buildInfo.ts and are injected at build time via bun build --define, falling back to empty strings that disable each integration — so binaries built from source send nothing. Both share the existing anonymous id, and the README's privacy guarantee is preserved: org/repo names, tokens, report contents, and the machine hostname never leave the user's machine. Also adds a pull request template (separate commit).

Review focus

  • Privacy hardening in Telemetry.tsbeforeBreadcrumb drops every breadcrumb and beforeSend deletes server_name/request. The question worth scrutiny: is this sufficient against Sentry's defaults to truly guarantee no org/repo name or hostname can leak via an error event?
  • Init ordering and gating in index.tsSentry.init must run before createLogger so pinoIntegration subscribes to pino's diagnostics channel first. Telemetry is gated to NoopTelemetry/NoopAnalytics whenever creds are empty (local/dev build) or the user opted out.

Commits

  • fe6c32a — chore: add Sentry crash reporting alongside PostHog analytics
  • 416312d — chore: add pull request template

blimmer added 2 commits May 25, 2026 10:11
Introduce opt-in Sentry error reporting for unexpected crashes, sharing
the existing anonymous id with PostHog. Telemetry credentials (Sentry DSN,
PostHog key/host) move out of source and are injected at build time via
`bun build --define` (buildInfo.ts), falling back to empty strings that
disable each integration for local/dev builds.

Sentry.init runs before the logger so its pinoIntegration subscribes to
pino's diagnostics channel first, and is hardened for privacy: breadcrumbs
are dropped and server_name/request are stripped so org/repo names and the
machine hostname never leave the box. The release workflow validates the
credentials are present before building.
@blimmer
blimmer marked this pull request as ready for review May 25, 2026 16:12
@blimmer
blimmer merged commit 6972a3d into main May 25, 2026
8 checks passed
@blimmer
blimmer deleted the chore/sentry-crash-reporting branch May 25, 2026 16:13
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