-
Notifications
You must be signed in to change notification settings - Fork 10
/
rollbar.rb
71 lines (61 loc) · 3.26 KB
/
rollbar.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Rollbar.configure do |config|
config.access_token = Rails.application.secrets.rollbar_token
# Without configuration, Rollbar is enabled in all environments.
# To disable in specific environments, set config.enabled=false.
config.enabled = Rails.env.production? && config.access_token.present?
# By default, Rollbar will try to call the `current_user` controller method
# to fetch the logged-in user object, and then call that object's `id`,
# `username`, and `email` methods to fetch those properties. To customize:
# config.person_method = "my_current_user"
#
# Because of privacy concerns we do not want to send Personally identifiable information
# to rollbar. So let's mask these with just reusing the user's ID that has been hashed
config.person_id_method = 'id_as_hash'
config.person_username_method = 'id_as_hash'
config.person_email_method = 'id_as_hash'
# If you want to attach custom data to all exception and message reports,
# provide a lambda like the following. It should return a hash.
# config.custom_data_method = lambda { {:some_key => "some_value" } }
# Add exception class names to the exception_level_filters hash to
# change the level that exception is reported at. Note that if an exception
# has already been reported and logged the level will need to be changed
# via the rollbar interface.
# Valid levels: 'critical', 'error', 'warning', 'info', 'debug', 'ignore'
# 'ignore' will cause the exception to not be reported at all.
# config.exception_level_filters.merge!('MyCriticalException' => 'critical')
#
# You can also specify a callable, which will be called with the exception instance.
# config.exception_level_filters.merge!('MyCriticalException' => lambda { |e| 'critical' })
config.exception_level_filters['ActionController::RoutingError'] = 'ignore'
config.exception_level_filters['ActiveStorage::UnrepresentableError'] = 'ignore'
# Enable asynchronous reporting (uses girl_friday or Threading if girl_friday
# is not installed)
# config.use_async = true
# Supply your own async handler:
# config.async_handler = Proc.new { |payload|
# Thread.new { Rollbar.process_from_async_handler(payload) }
# }
# Enable asynchronous reporting (using sucker_punch)
# config.use_sucker_punch
# Enable delayed reporting (using Sidekiq)
# config.use_sidekiq
# You can supply custom Sidekiq options:
# config.use_sidekiq 'queue' => 'default'
# If your application runs behind a proxy server, you can set proxy parameters here.
# If https_proxy is set in your environment, that will be used. Settings here have precedence.
# The :host key is mandatory and must include the URL scheme (e.g. 'http://'), all other fields
# are optional.
#
# config.proxy = {
# host: 'http://some.proxy.server',
# port: 80,
# user: 'username_if_auth_required',
# password: 'password_if_auth_required'
# }
# If you run your staging application instance in production environment then
# you'll want to override the environment reported by `Rails.env` with an
# environment variable like this: `ROLLBAR_ENV=staging`. This is a recommended
# setup for Heroku. See:
# https://devcenter.heroku.com/articles/deploying-to-a-custom-rails-environment
config.environment = ENV['ROLLBAR_ENV'].presence || Rails.env
end