0.8.0 • Published 10 months ago
@nuux/sentry v0.8.0
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:
$ bundle
Install npm package:
$ yarn add @nuux/sentry
Configuration
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 = {}
end
Browser
- Add
sentry_meta_tag
into theapplication
layout. - Add
import "@nuux/sentry"
injavascripts/packs/application.js
as first line.
License
The gem is available as open source under the terms of the MIT License.