rollbar 2.7.1 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 307192963be4a3aefcd14f135c284089329768e8
4
- data.tar.gz: 827eab30ef25e8da4c2ad4befcd48f6e9d142794
3
+ metadata.gz: 02b1f207b7667f4649a6c2805f73d8df71ba24ec
4
+ data.tar.gz: fe08097d60766f76e75baa4ebe133dc36d49fc3b
5
5
  SHA512:
6
- metadata.gz: fa47e8350d65964e7077556ec9c5930ae429850ce83a8ca945dd57415429c8c800f7617d99b440e2596e01e7d0613b72f31b0d40f9a1341ffc75dec625ae9327
7
- data.tar.gz: 313592eef5826b4f7bb9674848b28d30b2e366fd4ad580b5a1478fb18d118ff9f49a6ad5d54bb349adc80794460ae8ae239b2e856d4680f9cd17921625c47a06
6
+ metadata.gz: 028215d0b1b0bbafc92b75b078618833a5e2c263c50333834d3c32c934fae9e97e412e9272dd3a4aaaf9b862c128f9857633e7d26e6d76714e9e7f6c4f919da4
7
+ data.tar.gz: 44b5505e3ac14dcaabce4b5ec2db7226c392e2991f1ea6e30500fb66c5feffdc60c5d439a262259747f0e59ef68ed865002369c46220eb9bf5d55904bd472919
data/.gitignore CHANGED
@@ -20,3 +20,7 @@ test/version_tmp
20
20
  tmp
21
21
  *.swp
22
22
  .idea/
23
+ .ruby-version
24
+ .byebug_history
25
+
26
+ gemfiles/vendor
@@ -0,0 +1,3 @@
1
+ [submodule "rollbar.js"]
2
+ path = rollbar.js
3
+ url = https://github.com/rollbar/rollbar.js.git
@@ -0,0 +1,21 @@
1
+ AllCops:
2
+ Exclude:
3
+ - 'vendor/**/*'
4
+ - 'gemfiles/vendor/**/*'
5
+
6
+ Style/HashSyntax:
7
+ EnforcedStyle: hash_rockets
8
+ SupportedStyles:
9
+ - hash_rockets
10
+
11
+ Metrics/LineLength:
12
+ Max: 1000
13
+
14
+ Style/DoubleNegation:
15
+ Enabled: false
16
+
17
+ Style/Lambda:
18
+ Enabled: false
19
+
20
+ Style/EachWithObject:
21
+ Enabled: false
@@ -22,8 +22,7 @@ jdk:
22
22
  - oraclejdk7
23
23
  - oraclejdk8
24
24
  env:
25
- - SKIP_DUMMY_ROLLBAR=true ROLLBAR_SSL_CERT_FILE=/home/travis/build/rollbar/rollbar-gem/spec/cacert.pem
26
- - SKIP_DUMMY_ROLLBAR=false ROLLBAR_SSL_CERT_FILE=/home/travis/build/rollbar/rollbar-gem/spec/cacert.pem
25
+ - ROLLBAR_SSL_CERT_FILE=/home/travis/build/rollbar/rollbar-gem/spec/cacert.pem
27
26
  gemfile:
28
27
  - gemfiles/rails30.gemfile
29
28
  - gemfiles/rails31.gemfile
@@ -40,8 +39,6 @@ matrix:
40
39
  # Seems to work with oraclejdk7.
41
40
  - rvm: jruby-19mode
42
41
  jdk: openjdk7
43
- env: SKIP_DUMMY_ROLLBAR=false
44
-
45
42
  exclude:
46
43
  # Don't run tests for non-jruby environments with the JDK.
47
44
  # NOTE: openjdk7 is missing from these exclusions so that Travis will run at least 1 build for the given rvm.
@@ -1,5 +1,30 @@
1
1
  # Change Log
2
2
 
3
+ ## 2.8.0
4
+
5
+ New features:
6
+
7
+ - Add before_process and transform hooks. See [#375](https://github.com/rollbar/rollbar-gem/pull/375)
8
+ - Rollbar.js instrumentation. See [#382](https://github.com/rollbar/rollbar-gem/pull/382)
9
+ - Add `disable_rack_monkey_patch` configuration option. See [#377](https://github.com/rollbar/rollbar-gem/pull/377)
10
+ - Add Rubocop config. See [#379](https://github.com/rollbar/rollbar-gem/pull/379)
11
+
12
+ Bug fixes:
13
+
14
+ - Notify deploy only on primary `:rollbar_role` server. See [#368](https://github.com/rollbar/rollbar-gem/pull/368)
15
+ - Fix `Rollbar::Notifier#report_custom_data_error`. See [#376](https://github.com/rollbar/rollbar-gem/pull/376)
16
+ - Reset the notifier when we use `Rollbar.preconfigure`. See [#378](https://github.com/rollbar/rollbar-gem/pull/378)
17
+ - Fix sucker_punch tests. See [#372](https://github.com/rollbar/rollbar-gem/pull/372)
18
+
19
+ Docs:
20
+
21
+ - Add link from README to configuration. See [#383](https://github.com/rollbar/rollbar-gem/pull/383)
22
+ - Add rough draft of configuration options documentation. See [#373](https://github.com/rollbar/rollbar-gem/pull/373)
23
+ - Add plain ruby docs. See [#374](https://github.com/rollbar/rollbar-gem/pull/374)
24
+ - Document exception level filters. See [#366](https://github.com/rollbar/rollbar-gem/pull/366)
25
+ - Fix typo in README.md Sending backtrace without rescued exceptions. See [#364](https://github.com/rollbar/rollbar-gem/pull/364)
26
+
27
+
3
28
  ## 2.7.1
4
29
 
5
30
  - Suggest using ROLLBAR_ENV for staging apps. See [#353](https://github.com/rollbar/rollbar-gem/pull/353).
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Rollbar notifier for Ruby [![Build Status](https://api.travis-ci.org/rollbar/rollbar-gem.svg?branch=v2.7.1)](https://travis-ci.org/rollbar/rollbar-gem/branches)
1
+ # Rollbar notifier for Ruby [![Build Status](https://api.travis-ci.org/rollbar/rollbar-gem.svg?branch=v2.8.0)](https://travis-ci.org/rollbar/rollbar-gem/branches)
2
2
 
3
3
  <!-- RemoveNext -->
4
4
  [Rollbar](https://rollbar.com) is an error tracking service for Ruby and other languages. The Rollbar service will alert you of problems with your code and help you understand them in a ways never possible before. We love it and we hope you will too.
@@ -12,7 +12,7 @@ This is the Ruby library for Rollbar. It will instrument many kinds of Ruby appl
12
12
  Add this line to your application's Gemfile:
13
13
 
14
14
  ```ruby
15
- gem 'rollbar', '~> 2.7.1'
15
+ gem 'rollbar', '~> 2.8.0'
16
16
  ```
17
17
 
18
18
  And then execute:
@@ -99,6 +99,57 @@ class MyApp < Sinatra::Base
99
99
  end
100
100
  ```
101
101
 
102
+ ### If using Plain Ruby
103
+
104
+ Rollbar isn't dependent on Rack or Rails for most of its functionality. In a regular script, assuming you've
105
+ installed the rollbar gem:
106
+
107
+ 1. Require rollbar
108
+ 2. Configure rollbar
109
+ 3. Send Rollbar data
110
+
111
+ ```ruby
112
+ require 'rollbar'
113
+
114
+ Rollbar.configure do |config|
115
+ config.access_token = "POST_SERVER_ITEM_ACCESS_TOKEN"
116
+ # Other Configuration Settings
117
+ end
118
+
119
+ Rollbar.debug("Running Script")
120
+
121
+ begin
122
+ run_script ARGV
123
+ rescue Exception => e # Never rescue Exception *unless* you re-raise in rescue body
124
+ Rollbar.error(e)
125
+ raise e
126
+ end
127
+
128
+ Rollbar.info("Script ran successfully")
129
+ ```
130
+
131
+
132
+ ## Integration with Rollbar.js
133
+
134
+ In case you want to report your JavaScript errors using [Rollbar.js](https://github.com/rollbar/rollbar.js), you can configure the gem to enable Rollbar.js on your site. Example:
135
+
136
+ ```ruby
137
+ Rollbar.configure do |config|
138
+ # common gem configuration
139
+ # ...
140
+ config.js_enabled = true
141
+ config.js_options = {
142
+ accessToken: "POST_CLIENT_ITEM_ACCESS_TOKEN",
143
+ captureUncaught: true,
144
+ payload: {
145
+ environment: "production"
146
+ }
147
+ }
148
+ end
149
+ ```
150
+
151
+ The `Hash` passed to `#js_options=` should have the same availalbe options that you can find in [Rollbar.js](https://github.com/rollbar/rollbar.js), using symbols or strings for the keys.
152
+
102
153
  ## Test your installation
103
154
 
104
155
  To confirm that it worked, run:
@@ -379,7 +430,14 @@ By default, all uncaught exceptions are reported at the "error" level, except fo
379
430
  - ```AbstractController::ActionNotFound```
380
431
  - ```ActionController::RoutingError```
381
432
 
382
- If you'd like to customize this list, see the example code in ```config/initializers/rollbar.rb```. Supported levels: "critical", "error", "warning", "info", "debug", "ignore". Set to "ignore" to cause the exception not to be reported at all.
433
+ If you'd like to customize this list, modify the example code in ```config/initializers/rollbar.rb```. Supported levels: "critical", "error", "warning", "info", "debug", "ignore". Set to "ignore" to cause the exception not to be reported at all. For example, to ignore 404s and treat `NoMethodError`s as critical bugs, you can use the following code:
434
+
435
+ ```ruby
436
+ config.exception_level_filters.merge!({
437
+ 'ActiveRecord::RecordNotFound': 'ignore'
438
+ 'NoMethodError': 'critical'
439
+ })
440
+ ```
383
441
 
384
442
  This behavior applies to uncaught exceptions, not direct calls to `Rollbar.error()`, `Rollbar.warning()`, etc. If you are making a direct call to one of the log methods and want exception level filters to apply, pass an extra keyword argument:
385
443
 
@@ -387,6 +445,84 @@ This behavior applies to uncaught exceptions, not direct calls to `Rollbar.error
387
445
  Rollbar.error(exception, :use_exception_level_filters => true)
388
446
  ```
389
447
 
448
+ ## [Before process hook](#before-process-hook)
449
+
450
+ Before we process data sent to Rollbar.log (or Rollbar.error/info/etc.) to build and send the payload, the gem will call the handlers defined in `configuration.before_process`. This handlers should be `Proc` objects or objects responding to `#call` method. The received argument is a `Hash` object with these keys:
451
+
452
+ - `level`: the level used for the report.
453
+ - `exception`: the exception that caused the report, if any.
454
+ - `message`: the message to use for the report, if any.
455
+ - `extra`: extra data passed to the report methods.
456
+ - `scope`: the current Scope; see [Scope](#the-scope)
457
+
458
+ If the exception `Rollbar::Ignore` is raised inside any of the handlers defined for `configuration.before_process`, we'll ignore the report and not send it to the API. For example:
459
+
460
+ ```ruby
461
+ handler = proc do |options|
462
+ raise Rollbar::Ignore if any_smart_method(options)
463
+ end
464
+
465
+ Rollbar.configure do |config|
466
+ config.before_process << handler
467
+ end
468
+ ```
469
+
470
+ ## [Transform hook](#transform-hook]
471
+
472
+ After the payload is built but before it it sent to our API, the gem will call the handlers defined in `configuration.transform`. This handlers should be `Proc` objects or objects responding to `#call` method. The received argument is a `Hash` object with these keys:
473
+
474
+ - `level`: the level used for the report.
475
+ - `exception`: the exception that caused the report, if any.
476
+ - `message`: the message to use for the report, if any.
477
+ - `extra`: extra data passed to the report methods.
478
+ - `scope`: the current Scope; see [Scope](#the-scope)
479
+ - `payload`: the built payload that will be sent to the API
480
+
481
+ Handlers may mutate the payload. For example:
482
+
483
+ ```ruby
484
+ handler = proc do |options|
485
+ payload = options[:payload]
486
+
487
+ payload['data']['environment'] = 'foo'
488
+ end
489
+
490
+ Rollbar.configure do |config|
491
+ config.before_process << handler
492
+ end
493
+ ```
494
+
495
+ ## [The Scope](#the-scope)
496
+
497
+ The scope an object, an instance of `Rollbar::LazyStore` that stores the current context data for a certain moment or situation. For example, the Rails middleware defines the scope in a way similar to this:
498
+
499
+ ```ruby
500
+ scope = {request: request_data,
501
+ person: person_data,
502
+ context: context_data
503
+ }
504
+ Rollbar.scoped(scope) do
505
+ begin
506
+ @app.call(env)
507
+ rescue Exception => exception
508
+ # ...
509
+ end
510
+ end
511
+
512
+ ```
513
+
514
+ You can access the scope on the [before_process](#before-process-hook) and [transform](#transform-hook) hooks like this:
515
+
516
+ ```ruby
517
+ your_handler = proc do |options|
518
+ scope = options[:scope]
519
+
520
+ request_data = scope[:request]
521
+ person_data = scope[:person]
522
+ context_data = scope[:context]
523
+ end
524
+ ```
525
+
390
526
  ## Silencing exceptions at runtime
391
527
 
392
528
  If you just want to disable exception reporting for a single block, use ```Rollbar.silenced```:
@@ -406,7 +542,7 @@ exception = MyException.new('this is a message')
406
542
  Rollbar.error(exception)
407
543
  ```
408
544
 
409
- You will notice a backtrace doesn't appear in your Rollbar dashboard. This is because `exception.backtrace` is `nil` in these cases. We can send the current backtrace for you even your exception doesn't have it. In order to enable this feature you should configure Rollbar in this way:
545
+ You will notice a backtrace doesn't appear in your Rollbar dashboard. This is because `exception.backtrace` is `nil` in these cases. We can send the current backtrace for you even if your exception doesn't have it. In order to enable this feature you should configure Rollbar in this way:
410
546
 
411
547
  ```ruby
412
548
  Rollbar.configure do |config|
@@ -693,6 +829,12 @@ end
693
829
 
694
830
  Some users have reported problems with Zeus when ```rake``` was not explicitly included in their Gemfile. If the zeus server fails to start after installing the rollbar gem, try explicitly adding ```gem 'rake'``` to your ```Gemfile```. See [this thread](https://github.com/rollbar/rollbar-gem/issues/30) for more information.
695
831
 
832
+
833
+ ## Configuration options
834
+
835
+ For a listing of all configuration options available see
836
+ [configuration options](https://www.rollbar.com/docs/notifier/rollbar-gem/configuration).
837
+
696
838
  ## Backwards Compatibility
697
839
 
698
840
  You can find upgrading notes in [UPGRADING.md](UPGRADING.md).
data/Rakefile CHANGED
@@ -11,9 +11,11 @@ desc 'Run specs'
11
11
  task :default do
12
12
  ENV['LOCAL'] = '1'
13
13
  Rake::Task[:spec].invoke
14
-
14
+
15
15
  Rake::Task[:spec].reenable
16
-
16
+
17
17
  ENV['LOCAL'] = '0'
18
18
  Rake::Task[:spec].invoke
19
- end
19
+ end
20
+
21
+ Dir.glob('lib/tasks/*.rake').each { |r| load r }
@@ -0,0 +1 @@
1
+ !function(r){function o(e){if(t[e])return t[e].exports;var n=t[e]={exports:{},id:e,loaded:!1};return r[e].call(n.exports,n,n.exports,o),n.loaded=!0,n.exports}var t={};return o.m=r,o.c=t,o.p="",o(0)}([function(r,o,t){"use strict";var e=t(1).Rollbar,n=t(2);_rollbarConfig.rollbarJsUrl=_rollbarConfig.rollbarJsUrl||"https://d37gvrvc0wt4s1.cloudfront.net/js/v1.8/rollbar.min.js";var a=e.init(window,_rollbarConfig),i=n(a,_rollbarConfig);a.loadFull(window,document,!_rollbarConfig.async,_rollbarConfig,i)},function(r,o){"use strict";function t(r){return function(){try{return r.apply(this,arguments)}catch(o){try{console.error("[Rollbar]: Internal error",o)}catch(t){}}}}function e(r,o,t){window._rollbarWrappedError&&(t[4]||(t[4]=window._rollbarWrappedError),t[5]||(t[5]=window._rollbarWrappedError._rollbarContext),window._rollbarWrappedError=null),r.uncaughtError.apply(r,t),o&&o.apply(window,t)}function n(r){var o=function(){var o=Array.prototype.slice.call(arguments,0);e(r,r._rollbarOldOnError,o)};return o.belongsToShim=!0,o}function a(r){this.shimId=++s,this.notifier=null,this.parentShim=r,this._rollbarOldOnError=null}function i(r){var o=a;return t(function(){if(this.notifier)return this.notifier[r].apply(this.notifier,arguments);var t=this,e="scope"===r;e&&(t=new o(this));var n=Array.prototype.slice.call(arguments,0),a={shim:t,method:r,args:n,ts:new Date};return window._rollbarShimQueue.push(a),e?t:void 0})}function l(r,o){if(o.hasOwnProperty&&o.hasOwnProperty("addEventListener")){var t=o.addEventListener;o.addEventListener=function(o,e,n){t.call(this,o,r.wrap(e),n)};var e=o.removeEventListener;o.removeEventListener=function(r,o,t){e.call(this,r,o&&o._wrapped?o._wrapped:o,t)}}}var s=0;a.init=function(r,o){var e=o.globalAlias||"Rollbar";if("object"==typeof r[e])return r[e];r._rollbarShimQueue=[],r._rollbarWrappedError=null,o=o||{};var i=new a;return t(function(){if(i.configure(o),o.captureUncaught){i._rollbarOldOnError=r.onerror,r.onerror=n(i);var t,a,s="EventTarget,Window,Node,ApplicationCache,AudioTrackList,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(",");for(t=0;t<s.length;++t)a=s[t],r[a]&&r[a].prototype&&l(i,r[a].prototype)}return r[e]=i,i})()},a.prototype.loadFull=function(r,o,e,n,a){var i=function(){var o;if(void 0===r._rollbarPayloadQueue){var t,e,n,i;for(o=new Error("rollbar.js did not load");t=r._rollbarShimQueue.shift();)for(n=t.args,i=0;i<n.length;++i)if(e=n[i],"function"==typeof e){e(o);break}}"function"==typeof a&&a(o)},l=!1,s=o.createElement("script"),u=o.getElementsByTagName("script")[0],p=u.parentNode;s.crossOrigin="",s.src=n.rollbarJsUrl,s.async=!e,s.onload=s.onreadystatechange=t(function(){if(!(l||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState)){s.onload=s.onreadystatechange=null;try{p.removeChild(s)}catch(r){}l=!0,i()}}),p.insertBefore(s,u)},a.prototype.wrap=function(r,o){try{var t;if(t="function"==typeof o?o:function(){return o||{}},"function"!=typeof r)return r;if(r._isWrap)return r;if(!r._wrapped){r._wrapped=function(){try{return r.apply(this,arguments)}catch(o){throw o._rollbarContext=t()||{},o._rollbarContext._wrappedSource=r.toString(),window._rollbarWrappedError=o,o}},r._wrapped._isWrap=!0;for(var e in r)r.hasOwnProperty(e)&&(r._wrapped[e]=r[e])}return r._wrapped}catch(n){return r}};for(var u="log,debug,info,warn,warning,error,critical,global,configure,scope,uncaughtError".split(","),p=0;p<u.length;++p)a.prototype[u[p]]=i(u[p]);r.exports={Rollbar:a,_rollbarWindowOnError:e}},function(r,o){"use strict";r.exports=function(r,o){return function(t){if(!t&&!window._rollbarInitialized){var e=window.RollbarNotifier,n=o||{},a=n.globalAlias||"Rollbar",i=window.Rollbar.init(n,r);i._processShimQueue(window._rollbarShimQueue||[]),window[a]=i,window._rollbarInitialized=!0,e.processPayloads()}}}}]);
@@ -0,0 +1,281 @@
1
+ # Configuration Reference
2
+
3
+ <!-- Sub:[TOC] -->
4
+
5
+ ## General Settings
6
+
7
+ ### access_token
8
+
9
+ **Required**
10
+
11
+ Sets the access token used to send payloads to rollbar.
12
+
13
+ Items sent through a given access token arrive in that access token's project
14
+ and respect the rate limits set on that access token.
15
+
16
+ ### async_handler
17
+
18
+ If `config.use_async = true` explicitly sets the function used to send
19
+ asynchronous payloads to Rollbar. Should be an object that responds to `#call``
20
+ Not needed if using one of the built in async reporters:
21
+
22
+ * girl_friday
23
+ * sucker_punch
24
+ * Sidekiq
25
+ * Resque
26
+ * threading
27
+
28
+ ### branch
29
+
30
+ Name of the checked-out source control branch.
31
+
32
+ ### code_version
33
+
34
+ A string, up to 40 characters, describing the version of the application code.
35
+
36
+ Rollbar understands these formats:
37
+
38
+ * semantic version (i.e. "2.1.12")
39
+ * integer (i.e. "45")
40
+ * git SHA (i.e. "3da541559918a808c2402bba5012f6c60b27661c")
41
+
42
+ ### custom_data_method
43
+
44
+ The method to call to gather custom data to send with each rollbar request.
45
+
46
+ ```ruby
47
+ def custom_data
48
+ return {
49
+ :custom => {
50
+ :key1 => get_key_one,
51
+ :key2 => get_key_two
52
+ },
53
+ :server => {
54
+ :root => '/home/username/www/'
55
+ }
56
+ }
57
+ end
58
+ ```
59
+
60
+ ### default_logger
61
+
62
+ **Default** `Logger.new(STDERR)`
63
+
64
+ What logger to use for printing debugging and informational messages during
65
+ operation.
66
+
67
+ ### disable_monkey_patch
68
+
69
+ **Default** `false`
70
+
71
+ Disables monkey patching all non-core monkey patches and automatic reporting.
72
+
73
+ If you set this to true you will be responsible for rescuing and reporting all
74
+ errors manually.
75
+
76
+ ### disable_core_monkey_patch
77
+
78
+ **Default** `false`
79
+
80
+ Disables our monkey patches in the ruby core. One mandatory monkey patch is left.
81
+ Be careful using this option as it may caused unexpected behavior in some situations.
82
+
83
+
84
+ ### disable_rack_monkey_patch
85
+
86
+ **Default** `false`
87
+
88
+ Disables monkey patches on Rack classes, `Rack::Builder` for now, maybe more
89
+ at some point.
90
+
91
+ ### delayed_job_enabled
92
+
93
+ **Default** `true`
94
+
95
+
96
+ Set to false if you have `delayed_job` but do not wish to wrap jobs with a
97
+ Rollbar notifier.
98
+
99
+ ### dj_threshold
100
+
101
+ **Default** 0 (Report *any* errors)
102
+
103
+ The number of job failures before reporting the failure to Rollbar.
104
+
105
+ ### failover_handlers
106
+
107
+ An array of backup handlers if the async handlers fails. Each should respond to
108
+ `#call` and should receive a `payload`.
109
+
110
+ ### filepath
111
+
112
+ For use with `write_to_file`. Indicates location of the rollbar log file being
113
+ tracked by [rollbar-agent](https://github.com/rollbar/rollbar-agent).
114
+
115
+ ### framework
116
+
117
+ **Default** 'Plain'
118
+
119
+ Indicates which framework you're using. Common options include 'Rails',
120
+ 'Sinatra', and 'Rack' to name a few.
121
+
122
+ ### ignored_person_ids
123
+
124
+ **Default** `[]`
125
+
126
+ Ids of people whose reports you wish to ignore. Only works in conjunction with a
127
+ properly defined `person_method` or `person_id_method`.
128
+
129
+ ### logger
130
+
131
+ The logger to use *instead of* the default logger. Especially useful when you
132
+ wish to send log messages elsewhere.
133
+
134
+ ### payload_options
135
+
136
+ Extra data to send with the payload.
137
+
138
+ ### person_method
139
+
140
+ Rails only: A string or symbol giving the name of the method on the controller.
141
+ Should return an object with an `id` method, and optionally `username` and
142
+ `email` methods. The names of the `id`, `username` and `email` methods can be
143
+ overridden. See `person_id_method`, `person_username_method`, and
144
+ `person_email_method`.
145
+
146
+ If not using Rails:
147
+
148
+ Populate the `rollbar.person_data` key with a hash containing `:id`, and
149
+ optionally `:username` and `:email`.
150
+
151
+ ### person_id_method
152
+
153
+ A string or symbol giving the name of the method on the user instance that
154
+ returns the person's id. Gets called on the result of `person_method`. Ignored
155
+ if `person_method` not present.
156
+
157
+ ### person_username_method
158
+
159
+ A string or symbol giving the name of the method on the user instance that
160
+ returns the person's username. Gets called on the result of `person_method`.
161
+ Ignored if `person_method` not present.
162
+
163
+ ### person_email_method
164
+
165
+ A string or symbol giving the name of the method on the user instance that
166
+ returns the person's email. Gets called on the result of `person_method`.
167
+ Ignored if `person_method` not present.
168
+
169
+ ### populate_empty_backtraces
170
+
171
+ Raising an exception in Ruby is what populates the backtraces. If you report a
172
+ manually initialized exception instead of a raised and rescued exception, the
173
+ backtraces will be empty. Set `populate_empty_backtraces` to `true` to have
174
+ Rollbar load the traces before sending them.
175
+
176
+ ### report_dj_data
177
+
178
+ **Default** `true`
179
+
180
+ Set to `false` to skip automatic bundling of job metadata like queue, job class
181
+ name, and job options.
182
+
183
+ ### request_timeout
184
+
185
+ **Default** `3`
186
+
187
+ Set the request timeout for sending POST data to Rollbar.
188
+
189
+ ### root
190
+
191
+ Set the server root, all stack frames outside that root are considered
192
+ 'non-project' frames. Also used to setup Github linking.
193
+
194
+ ### safely
195
+
196
+ **Default** `false`
197
+
198
+ When `true` evaluates `custom_data_method` returns `{}` if an error,
199
+ otherwise reports the error to Rollbar.
200
+
201
+ ### scrub_fields
202
+
203
+ Fields to scrub out of the parsed request data. Will scrub from `GET`, `POST`,
204
+ url, and several other locations. Does not currently recurse into the full
205
+ payload.
206
+
207
+ ### scrub_user
208
+
209
+ **Default** `true`
210
+
211
+ Set to false to skip scrubbing user out of the URL.
212
+
213
+ ### scrub_password
214
+
215
+ Set to false to skip scrubbing password out of the URL.
216
+
217
+ ### user_ip_obfuscator_secret
218
+
219
+ A string used hash IP addresses when obfuscating them.
220
+
221
+ ### randomize_scrub_length
222
+
223
+ **Default** `true`
224
+
225
+ When true randomizes the number of asterisks used to display scrubbed fields.
226
+
227
+ ### uncaught_exception_level
228
+
229
+ **Default** `error`
230
+
231
+ Use this field to select a different level for uncaught errors (like `critical`,
232
+ or `warning`).
233
+
234
+ ### scrub_headers
235
+
236
+ **Default** `["Authentication"]`
237
+
238
+ The headers to scrub.
239
+
240
+ ### sidekiq_threshold
241
+
242
+ **Default** `0`
243
+
244
+ The number of job re-tries before reporting an error to Rollbar via Sidekiq.
245
+ Ignored unless you've called `use_sidekiq`.
246
+
247
+ ### verify_ssl_peer
248
+
249
+ **Default** `true`
250
+
251
+ By default we use `OpenSSL::SSL::VERIFY_PEER` for SSL. Although we don't
252
+ recommend changing it, you can disable peer verification in case you experience
253
+ SSL connection problems.
254
+
255
+ ### use_async
256
+
257
+ **Default** `false`
258
+
259
+ When `true` indicates you wish to send data to Rollbar asynchronously. If
260
+ installed, uses `girl_friday`, otherwise defaults to `Thread`.
261
+
262
+ ### use_eventmachine
263
+
264
+ **Default** `false`
265
+
266
+ When `true` indicates you wish to send data to Rollbar with `eventmachine`.
267
+ Won't work unless `eventmachine` is installed.
268
+
269
+ ### web_base
270
+
271
+ **Default** `'https://rollbar.com'`
272
+
273
+ The root of the web app that serves your rollbar data. Unless you're an
274
+ enterprise customer this should never change.
275
+
276
+ ### write_to_file
277
+
278
+ **Default** `false`
279
+
280
+ If `true` writes all errors to a log file which can be sent with
281
+ `rollbar-agent`.