Skip to content

feat: add more sentry-native features to demo #14

Description

@JoshuaMoelans

With #12 we also found the following "missing" features; none are super important, but could be nice-to-haves as part of the demo.

  • External Crash reporter — with make crash-reporter we bundle this in, but currently the user feedback seems to not be working (returns "Response status code does not indicate success: 403 (Forbidden)."). This might also be an issue with the external reporter itself.
  • Offline caching / cache keep (sentry_options_set_cache_keep, set_cache_max_items/size/age) — Add a "Go Offline" toggle in the Settings panel that simulates network loss. Events would queue locally and drain when toggled back. Very visual for demos. Implementation: the SDK handles this internally once the options are set; we'd just need to enable SENTRY_CACHE_KEEP_ALWAYS and expose a UI toggle.
  • HTTP retry (sentry_options_set_http_retry) — Pairs naturally with offline caching above. Enable it in sentry_manager.cpp alongside the cache options. One line in init(). Could show retry behavior in the console log when the backend is unreachable.
  • before_screenshot hook (sentry_options_set_before_screenshot) — Could wire this up in sentry_manager.cpp to stamp the screenshot with an overlay (e.g. timestamp or scenario name) before capture. Only fires on Windows where SDK screenshots are enabled. Niche value.
  • before_send_log / before_send_metric (sentry_options_set_before_send_log, sentry_options_set_before_send_metric) — Filter hooks for logs and metrics. Could add a Settings toggle to suppress certain log levels or metric names, showing how an app can gate telemetry at runtime. Implementation in sentry_manager.cpp alongside before_send.
  • Attachment types (sentry_attachment_set_type, SENTRY_ATTACHMENT_TYPE_*) — The calibration blob in the convoluted chain scenario currently uses plain sentry_attach_bytes. Could call sentry_attachment_set_type to mark it as a specific type for richer display in the Sentry UI. Small change in chaos.cpp.
  • Attachment content type (sentry_attachment_set_content_type) — Set MIME types on attachments (calibration blob as application/octet-stream, screenshot as image/png). Pairs with attachment types above.
  • User consent management (sentry_user_consent_give/revoke/get) — Add a GDPR-style consent toggle in Settings. When revoked, events are cached but not sent; when given, the backlog drains. Pairs with offline caching (nr.1). Would need a consent state in the UI and calls in sentry_manager.cpp.
  • Large attachment uploads (sentry_options_set_enable_large_attachments) — Experimental TUS-based upload for large files. The app-hang scenario already attaches a 256 KB blob; could bump that to several MB and enable this option to show it working. One-line option in sentry_manager.cpp, size bump in chaos.cpp.
  • on_crash callback (sentry_options_set_on_crash) — Separate hook that fires only on crashes, replacing before_send for crash events. Could use this for crash-specific enrichment while keeping before_send for non-crash events. Good teaching example for the before_send / on_crash split.
  • Crashed-last-run detection (sentry_get_crashed_last_run) — Check at startup whether the previous run crashed. Could show a "last session crashed" banner in the UI. Very visual and easy to implement — one call right after sentry_init.
  • dist option (sentry_options_set_dist) — Set to "macos" / "linux" / "windows" so Sentry can distinguish OS builds of the same release. One-liner in sentry_manager.cpp using the existing EMPOWER_PLATFORM macro.
  • Client reports (sentry_options_set_send_client_reports) — Track discarded/filtered events in Sentry. One-liner in sentry_manager.cpp. Pairs well with the filtering callbacks above — shows what got dropped.
  • sentry_metrics_count — The demo uses gauge and distribution but not count. Adding a counter (e.g. "scenarios triggered") would complete the metrics trifecta. Small change in chaos.cpp.
  • Programmatic user feedback (sentry_capture_feedback_with_hint) — A "Send Feedback" button in the UI, capturing feedback via the API rather than only through the external crash reporter. Would need a small text-input dialog in the GUI.
  • Local scopes (sentry_local_scope_new + sentry_capture_event_with_scope) — Per-event scope enrichment without polluting the global scope. The chaos scenarios currently set tags globally; local scopes would be cleaner and demonstrate the API.
  • Transaction filtering (sentry_options_set_before_transaction) — Filter or modify transactions before send. Could add a Settings toggle to drop certain transaction types, showing how an app can control which traces are sent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions