0.8.2 • Published 8 months ago
@nuux/sentry v0.8.2
Nuux::Sentry
Automatically configures Sentry for your Rails application.
Installation
Add this line to your application's Gemfile:
gem "nuux-sentry", git: "https://user:password@git.nuux.de/gems/nuux-sentry.git"And then execute:
$ bundleInstall npm package:
$ yarn add @nuux/sentryConfiguration
Rails
Define SENTRY_DSN as environment variable.
Default configuration
Nuux::Sentry.configure do |config|
config.environments = %w[staging production]
config.user = proc { try(:current_user) }
config.user_attributes = %i[id username]
config.browser_user_attributes = config.user_attributes
config.user_context = proc { { ip_address: request.remote_ip } }
config.extra_context = {}
endBrowser
- Add
sentry_meta_taginto theapplicationlayout. - Add
import "@nuux/sentry"injavascripts/packs/application.jsas first line.
License
The gem is available as open source under the terms of the MIT License.