Skip to content

feat(observability): add Sentry error reporting to Rust core#131

Merged
senamakel merged 7 commits into
tinyhumansai:mainfrom
senamakel:feat/sentry
Mar 31, 2026
Merged

feat(observability): add Sentry error reporting to Rust core#131
senamakel merged 7 commits into
tinyhumansai:mainfrom
senamakel:feat/sentry

Conversation

@senamakel
Copy link
Copy Markdown
Member

Summary

  • Integrates Sentry SDK (v0.47) into the openhuman-core Rust binary for crash and error reporting
  • Adds sentry-tracing layer so tracing::error! events are captured as Sentry events, WARN/INFO as breadcrumbs
  • Strips all PII: send_default_pii: false, hostname removed, user context removed, secrets scrubbed from exception messages (Bearer tokens, API keys, sk-*, token=...)
  • DSN configured via OPENHUMAN_SENTRY_DSN env var (no-op when unset — safe for local dev)
  • Frontend Sentry was already integrated (@sentry/react, privacy-first error queue, consent toggle)

Closes #37

Changes

  • Cargo.toml — add sentry crate with tracing, panic, rustls features
  • src/main.rs — Sentry init as first operation, before_send hook with secret scrubbing
  • src/core/logging.rs — refactor subscriber to layered Registry + sentry-tracing layer
  • src/openhuman/config/schema/observability.rs — add sentry_dsn field
  • src/openhuman/config/schema/load.rs — add OPENHUMAN_SENTRY_DSN env override
  • .env.example — document the new env var

Test plan

  • cargo check passes
  • Run with no OPENHUMAN_SENTRY_DSN — Sentry is no-op, CLI output unchanged
  • Run with DSN set — verify errors appear in Sentry dashboard
  • Inspect Sentry events — confirm no hostname, user data, or API keys in payloads
  • Frontend + core report to separate Sentry projects via their respective DSN env vars

🤖 Generated with Claude Code

senamakel and others added 7 commits March 31, 2026 10:52
…figuration support

- Added Sentry integration for error reporting in the application, initializing it in the main function.
- Introduced a new environment variable `OPENHUMAN_SENTRY_DSN` to configure Sentry DSN.
- Updated the observability configuration schema to include a field for Sentry DSN.
- Enhanced logging to include Sentry event filtering based on log levels.
- Implemented secret scrubbing to protect sensitive information in error reports.
- Introduced new environment variable `OPENHUMAN_ANALYTICS_ENABLED` to enable or disable anonymized analytics and crash reports.
- Updated the PrivacyPanel component to sync analytics consent with the core configuration.
- Added new functions to handle analytics settings updates and retrieval in the Tauri backend.
- Enhanced observability configuration to include analytics settings, defaulting to enabled.
- Updated relevant schemas and handlers for analytics settings in the backend.
…s settings function

- Reformatted the `openhumanUpdateAnalyticsSettings` function for better readability by adjusting the parameter structure.
- Enhanced the output formatting in the `handle_get_analytics_settings` function for improved clarity in the JSON response.
…mization copy

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@senamakel senamakel merged commit 906b55b into tinyhumansai:main Mar 31, 2026
6 of 7 checks passed
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.

Set Up Sentry to Production

1 participant