Skip to content

feature: Improve Sentry integration #10169

Description

@gustavovalverde

Motivation

Sentry is enabled by default (sentry feature in default-release-binaries) but the current integration is minimal. Better configuration and context would improve error tracking.

Current State

Location: zebrad/src/application.rs:405-409

let guard = sentry::init(sentry::ClientOptions {
    debug: true,
    release: Some(build_version().to_string().into()),
    ..Default::default()
});
  • Only sets debug and release version
  • DSN only via SENTRY_DSN env var
  • No environment tagging
  • No performance monitoring
  • No explicit PII protection

Tasks

  • Add environment tagging (production, staging, development)
  • Add send_default_pii: false explicitly
  • Add configurable traces_sample_rate for performance monitoring
  • Consider making DSN configurable via config file (not just env var)
  • Verify breadcrumb integration with tracing layer
  • Add rayon thread pool panic forwarding to Sentry (TODO at line 430)

Implementation

Files to modify:

  • zebrad/src/application.rs - expand sentry::init() options
  • zebrad/src/components/tracing.rs - add Sentry config fields if needed

Example improved config:

sentry::init(sentry::ClientOptions {
    release: Some(build_version().to_string().into()),
    environment: Some(config.sentry.environment.clone().into()),
    traces_sample_rate: config.sentry.traces_sample_rate,
    send_default_pii: false,
    ..Default::default()
})

Acceptance Criteria

  • Environment visible in Sentry dashboard
  • PII protection explicit
  • Performance monitoring available (opt-in via sample rate)
  • Rayon panics forwarded to Sentry

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions