Thin provider gem that registers Sentry adapters into the Better Together adapter registry.
This gem keeps Sentry out of the Community Engine gem while allowing host apps to opt in to:
- error reporting
- browser Sentry head tags
- future metrics/observability fan-out
Add the gem to a CE host app and require it during boot.
gem 'better_together-sentry', path: '../better_together-sentry'The gem registers:
- an
:error_reportingadapter named:sentrywhenSentryis loaded - a head-tag provider for the browser Sentry CDN script when
SENTRY_CLIENT_KEYis present - the related CSP origins for that browser script
The adapter sends exception context into Sentry extra:.
If you need more control, replace the registration in an initializer:
BetterTogether.register_adapter(:error_reporting, :sentry) do |exception, context: {}|
Sentry.capture_exception(exception, tags: { subsystem: 'ce' }, extra: context)
end