Sentry integration for Verse services.
Error capture with rich context on every exposition (auth metadata, role and user tags, sanitized params) — including event-subscriber errors that Verse swallows after logging — plus three tracing modes.
# Gemfile
gem "verse-sentry"# config/config.yml
plugins:
- plugin: sentry
config:
dsn: <%= ENV["SENTRY_DSN"] %> # empty/missing DSN disables everything
tracing: none # none | native | otel
traces_sample_rate: <%= ENV.fetch("SENTRY_TRACES_SAMPLE_RATE", 0.1) %>The environment reported to Sentry comes from APP_ENVIRONMENT. Verse 4xx
business errors (NotFound, ValidationFailed, …) are excluded from issue
creation by default; override with excluded_exceptions.
sentry-ruby is the only hard dependency. Everything below is loaded lazily
and only when the matching config asks for it — add it to your service's
Gemfile, and the plugin will tell you (loudly, at boot) if it is missing.
| Gem | Needed for |
|---|---|
verse-otel |
tracing: otel |
sentry-opentelemetry |
tracing: otel |
stackprof |
profiles_sample_rate > 0 |
Nothing extra is required for tracing: none or tracing: native — Sequel
spans in native mode work off the Sequel you already have.
config:
enable_logs: true # mirror Verse.logger (stdlib Logger) into Sentry Logs
profiles_sample_rate: 0.1 # Sentry Profiles; relative to traces_sample_rateenable_logsturns on Sentry's structured logs and prepends the SDK's stdlib-Logger hook, so everything logged throughVerse.loggerappears in Sentry Logs (severity filtering follows the logger's own level).profiles_sample_raterequires thestackprofgem in your service's Gemfile and a tracing mode ofnativeorotel— profiles are captured per transaction, so withtracing: nonethe setting is ignored.
none— error tracking only.native— the Sentry SDK's own tracing: one transaction per exposition and child spans for every Sequel query. No OpenTelemetry gems needed.otel— bridge verse-otel's OpenTelemetry spans into Sentry. Requires theverse-otelandsentry-opentelemetrygems, plus theotelplugin declared in config.yml (order does not matter). Errors arrive automatically linked to their traces, and the SDK's own envelope uploads are excluded from tracing.
# Gemfile — otel mode
gem "verse-sentry"
gem "verse-otel"
gem "sentry-opentelemetry"# otel mode example
plugins:
- plugin: sentry
config:
dsn: <%= ENV["SENTRY_DSN"] %>
tracing: otel
traces_sample_rate: 1.0
- plugin: otel
config:
instrumentations: [rack, sinatra, net_http, pg, concurrent_ruby]bundle install
bundle exec rspec