Skip to content

feat(cli): wire errors-only Sentry/GlitchTip reporting - #1

Merged
Afgan0r merged 2 commits into
masterfrom
gsd/sentry-errors-only
Jun 15, 2026
Merged

feat(cli): wire errors-only Sentry/GlitchTip reporting#1
Afgan0r merged 2 commits into
masterfrom
gsd/sentry-errors-only

Conversation

@Afgan0r

@Afgan0r Afgan0r commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Wires an errors-only Sentry SDK (reporting to GlitchTip) into the replay-parser-2 binary per plans/replay-parser-2/briefs/sentry-wire.md.

What

  • Add sentry to parser-cli with default-features = false and a minimal errors-only feature set: backtrace, contexts, panic, reqwest, rustls. No tracing/profiling features.
  • Initialize the client guard as the first statement of main(), bound to let _sentry so it lives for the whole process (owns the panic hook, flushes pending events on drop). It outlives the worker's tokio runtime built inside the Worker subcommand.
  • DSN from SENTRY_DSN env var; empty/unset → disabled no-op client (the crate handles this).
  • environment = "staging", release = sentry::release_name!(). traces_sample_rate is never set → stays 0.0, errors only, no performance tracing.

Gate

  • cargo build
  • cargo test
  • cargo clippy --all-targets -- -D warnings
  • cargo fmt --check

Review

solidstats-parser-rust-code-review: APPROVE. Contract N/A (binary-only change); determinism + lint gates clean. No critical/high findings.

Notes

  • The brief says src/main.rs; the workspace's single binary entrypoint is crates/parser-cli/src/main.rs (the worker runs via the Worker subcommand inside it), so the guard there covers both CLI and worker process lifetimes.
  • Forced-error GlitchTip smoke test is operator-run with a live SENTRY_DSN; not performed here.
  • Explicit sentry::capture_error on handled CliError paths is intentionally out of scope — panics are auto-captured.

🤖 Generated with Claude Code

Afgan0r and others added 2 commits June 15, 2026 20:50
Initialize a Sentry client guard at the top of main() bound to a live
binding so it lives for the whole process and flushes events on drop. DSN
comes from SENTRY_DSN (empty/unset yields a disabled no-op client). Set
environment=staging and release=release_name!(); never set
traces_sample_rate, so reporting stays errors-only with no performance
tracing or profiling. Panics are captured by the panic integration.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Afgan0r
Afgan0r merged commit 72116db into master Jun 15, 2026
2 checks passed
@Afgan0r
Afgan0r deleted the gsd/sentry-errors-only branch June 15, 2026 13:54
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