rollbar 2.19.3 → 2.20.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 +4 -4
- data/Gemfile +12 -1
- data/data/rollbar.snippet.js +1 -1
- data/docs/configuration.md +9 -0
- data/gemfiles/rails30.gemfile +7 -0
- data/gemfiles/rails31.gemfile +7 -0
- data/gemfiles/rails32.gemfile +7 -0
- data/gemfiles/rails40.gemfile +7 -0
- data/gemfiles/rails41.gemfile +7 -0
- data/gemfiles/rails42.gemfile +7 -0
- data/gemfiles/rails50.gemfile +12 -1
- data/gemfiles/rails51.gemfile +12 -1
- data/gemfiles/rails52.gemfile +12 -1
- data/lib/rails/rollbar_runner.rb +1 -1
- data/lib/rollbar/configuration.rb +11 -1
- data/lib/rollbar/item.rb +18 -6
- data/lib/rollbar/logger_proxy.rb +5 -1
- data/lib/rollbar/notifier.rb +22 -7
- data/lib/rollbar/request_data_extractor.rb +4 -2
- data/lib/rollbar/scrubbers/params.rb +2 -2
- data/lib/rollbar/truncation.rb +2 -1
- data/lib/rollbar/truncation/strings_strategy.rb +1 -1
- data/lib/rollbar/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e879b78b311e11b9d124caf5d30c8dc9e0d831409a80459430fd557320926cbf
|
|
4
|
+
data.tar.gz: 5baf629685d3393055192355cf4974321004ed0a3e57b13f045eafe6631e4804
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 69e943c6de574b2589a3230fdf69159e0378066fb2ec9757e9716f4c839273ec97450d11058dfdd250b7e244e9d70f28bfb0799916b9765e797e5f5ecccbd022
|
|
7
|
+
data.tar.gz: 5213c8cd89294bd2ab4ac1e2ac9dacb43165449bed85d4dc7b8eae9d6f1b4beb1ac95e7526f5d2e11eb7633e2969c62330f577150732207e11004464384c8a2a
|
data/Gemfile
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
source 'https://rubygems.org'
|
|
4
4
|
|
|
5
|
+
# Used by spec/commands/rollbar_rails_runner_spec, and can be used whenever a
|
|
6
|
+
# new process is created during tests. (Testing rake tasks, for example.)
|
|
7
|
+
# This is a workaround for ENV['BUNDLE_GEMFILE'] not working as expected on Travis.
|
|
8
|
+
# We use the ||= assignment because Travis loads the gemfile twice, the second time
|
|
9
|
+
# with the wrong gemfile path.
|
|
10
|
+
ENV['CURRENT_GEMFILE'] ||= __FILE__
|
|
11
|
+
|
|
5
12
|
is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby')
|
|
6
13
|
|
|
7
14
|
gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
|
|
@@ -47,6 +54,11 @@ elsif RUBY_VERSION.start_with?('2')
|
|
|
47
54
|
gem 'sucker_punch', '~> 2.0' # rubocop:disable Bundler/DuplicatedGem
|
|
48
55
|
end
|
|
49
56
|
|
|
57
|
+
unless is_jruby
|
|
58
|
+
# JRuby doesn't support fork, which is required for this test helper.
|
|
59
|
+
gem 'rspec-command'
|
|
60
|
+
end
|
|
61
|
+
|
|
50
62
|
gem 'aws-sdk-sqs'
|
|
51
63
|
gem 'database_cleaner'
|
|
52
64
|
gem 'delayed_job', :require => false
|
|
@@ -54,7 +66,6 @@ gem 'generator_spec'
|
|
|
54
66
|
gem 'girl_friday', '>= 0.11.1'
|
|
55
67
|
gem 'redis'
|
|
56
68
|
gem 'resque', '< 2.0.0'
|
|
57
|
-
gem 'rspec-command'
|
|
58
69
|
gem 'rubocop', :require => false
|
|
59
70
|
gem 'sinatra'
|
|
60
71
|
gem 'webmock', :require => false
|
data/data/rollbar.snippet.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(r){function o(n){if(e[n])return e[n].exports;var t=e[n]={
|
|
1
|
+
!function(r){var e={};function o(n){if(e[n])return e[n].exports;var t=e[n]={i:n,l:!1,exports:{}};return r[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=r,o.c=e,o.d=function(r,e,n){o.o(r,e)||Object.defineProperty(r,e,{enumerable:!0,get:n})},o.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},o.t=function(r,e){if(1&e&&(r=o(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var t in r)o.d(n,t,function(e){return r[e]}.bind(null,t));return n},o.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return o.d(e,"a",e),e},o.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)},o.p="",o(o.s=0)}([function(r,e,o){var n=o(1),t=o(4);_rollbarConfig=_rollbarConfig||{},_rollbarConfig.rollbarJsUrl=_rollbarConfig.rollbarJsUrl||"https://cdnjs.cloudflare.com/ajax/libs/rollbar.js/2.7.1/rollbar.min.js",_rollbarConfig.async=void 0===_rollbarConfig.async||_rollbarConfig.async;var a=n.setupShim(window,_rollbarConfig),l=t(_rollbarConfig);window.rollbar=n.Rollbar,a.loadFull(window,document,!_rollbarConfig.async,_rollbarConfig,l)},function(r,e,o){var n=o(2);function t(r){return function(){try{return r.apply(this,arguments)}catch(r){try{console.error("[Rollbar]: Internal error",r)}catch(r){}}}}var a=0;function l(r,e){this.options=r,this._rollbarOldOnError=null;var o=a++;this.shimId=function(){return o},"undefined"!=typeof window&&window._rollbarShims&&(window._rollbarShims[o]={handler:e,messages:[]})}var i=o(3),d=function(r,e){return new l(r,e)},c=function(r){return new i(d,r)};function s(r){return t(function(){var e=Array.prototype.slice.call(arguments,0),o={shim:this,method:r,args:e,ts:new Date};window._rollbarShims[this.shimId()].messages.push(o)})}l.prototype.loadFull=function(r,e,o,n,a){var l=!1,i=e.createElement("script"),d=e.getElementsByTagName("script")[0],c=d.parentNode;i.crossOrigin="",i.src=n.rollbarJsUrl,o||(i.async=!0),i.onload=i.onreadystatechange=t(function(){if(!(l||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState)){i.onload=i.onreadystatechange=null;try{c.removeChild(i)}catch(r){}l=!0,function(){var e;if(void 0===r._rollbarDidLoad){e=new Error("rollbar.js did not load");for(var o,n,t,l,i=0;o=r._rollbarShims[i++];)for(o=o.messages||[];n=o.shift();)for(t=n.args||[],i=0;i<t.length;++i)if("function"==typeof(l=t[i])){l(e);break}}"function"==typeof a&&a(e)}()}}),c.insertBefore(i,d)},l.prototype.wrap=function(r,e,o){try{var n;if(n="function"==typeof e?e:function(){return e||{}},"function"!=typeof r)return r;if(r._isWrap)return r;if(!r._rollbar_wrapped&&(r._rollbar_wrapped=function(){o&&"function"==typeof o&&o.apply(this,arguments);try{return r.apply(this,arguments)}catch(o){var e=o;throw e&&("string"==typeof e&&(e=new String(e)),e._rollbarContext=n()||{},e._rollbarContext._wrappedSource=r.toString(),window._rollbarWrappedError=e),e}},r._rollbar_wrapped._isWrap=!0,r.hasOwnProperty))for(var t in r)r.hasOwnProperty(t)&&(r._rollbar_wrapped[t]=r[t]);return r._rollbar_wrapped}catch(e){return r}};for(var p="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleUnhandledRejection,captureEvent,captureDomContentLoaded,captureLoad".split(","),u=0;u<p.length;++u)l.prototype[p[u]]=s(p[u]);r.exports={setupShim:function(r,e){if(r){var o=e.globalAlias||"Rollbar";if("object"==typeof r[o])return r[o];r._rollbarShims={},r._rollbarWrappedError=null;var a=new c(e);return t(function(){e.captureUncaught&&(a._rollbarOldOnError=r.onerror,n.captureUncaughtExceptions(r,a,!0),n.wrapGlobals(r,a,!0)),e.captureUnhandledRejections&&n.captureUnhandledRejections(r,a,!0);var t=e.autoInstrument;return!1!==e.enabled&&(void 0===t||!0===t||"object"==typeof t&&t.network)&&r.addEventListener&&(r.addEventListener("load",a.captureLoad.bind(a)),r.addEventListener("DOMContentLoaded",a.captureDomContentLoaded.bind(a))),r[o]=a,a})()}},Rollbar:c}},function(r,e){function o(r,e,o){if(e.hasOwnProperty&&e.hasOwnProperty("addEventListener")){for(var n=e.addEventListener;n._rollbarOldAdd&&n.belongsToShim;)n=n._rollbarOldAdd;var t=function(e,o,t){n.call(this,e,r.wrap(o),t)};t._rollbarOldAdd=n,t.belongsToShim=o,e.addEventListener=t;for(var a=e.removeEventListener;a._rollbarOldRemove&&a.belongsToShim;)a=a._rollbarOldRemove;var l=function(r,e,o){a.call(this,r,e&&e._rollbar_wrapped||e,o)};l._rollbarOldRemove=a,l.belongsToShim=o,e.removeEventListener=l}}r.exports={captureUncaughtExceptions:function(r,e,o){if(r){var n;if("function"==typeof e._rollbarOldOnError)n=e._rollbarOldOnError;else if(r.onerror){for(n=r.onerror;n._rollbarOldOnError;)n=n._rollbarOldOnError;e._rollbarOldOnError=n}var t=function(){var o=Array.prototype.slice.call(arguments,0);!function(r,e,o,n){r._rollbarWrappedError&&(n[4]||(n[4]=r._rollbarWrappedError),n[5]||(n[5]=r._rollbarWrappedError._rollbarContext),r._rollbarWrappedError=null),e.handleUncaughtException.apply(e,n),o&&o.apply(r,n)}(r,e,n,o)};o&&(t._rollbarOldOnError=n),r.onerror=t}},captureUnhandledRejections:function(r,e,o){if(r){"function"==typeof r._rollbarURH&&r._rollbarURH.belongsToShim&&r.removeEventListener("unhandledrejection",r._rollbarURH);var n=function(r){var o,n,t;try{o=r.reason}catch(r){o=void 0}try{n=r.promise}catch(r){n="[unhandledrejection] error getting `promise` from event"}try{t=r.detail,!o&&t&&(o=t.reason,n=t.promise)}catch(r){}o||(o="[unhandledrejection] error getting `reason` from event"),e&&e.handleUnhandledRejection&&e.handleUnhandledRejection(o,n)};n.belongsToShim=o,r._rollbarURH=n,r.addEventListener("unhandledrejection",n)}},wrapGlobals:function(r,e,n){if(r){var t,a,l="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<l.length;++t)r[a=l[t]]&&r[a].prototype&&o(e,r[a].prototype,n)}}}},function(r,e){function o(r,e){this.impl=r(e,this),this.options=e,function(r){for(var e=function(r){return function(){var e=Array.prototype.slice.call(arguments,0);if(this.impl[r])return this.impl[r].apply(this.impl,e)}},o="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleUnhandledRejection,_createItem,wrap,loadFull,shimId,captureEvent,captureDomContentLoaded,captureLoad".split(","),n=0;n<o.length;n++)r[o[n]]=e(o[n])}(o.prototype)}o.prototype._swapAndProcessMessages=function(r,e){var o,n,t;for(this.impl=r(this.options);o=e.shift();)n=o.method,t=o.args,this[n]&&"function"==typeof this[n]&&("captureDomContentLoaded"===n||"captureLoad"===n?this[n].apply(this,[t[0],o.ts]):this[n].apply(this,t));return this},r.exports=o},function(r,e){r.exports=function(r){return function(e){if(!e&&!window._rollbarInitialized){for(var o,n,t=(r=r||{}).globalAlias||"Rollbar",a=window.rollbar,l=function(r){return new a(r)},i=0;o=window._rollbarShims[i++];)n||(n=o.handler),o.handler._swapAndProcessMessages(l,o.messages);window[t]=n,window._rollbarInitialized=!0}}}}]);
|
data/docs/configuration.md
CHANGED
|
@@ -242,6 +242,15 @@ Fields to scrub out of the parsed request data. Will scrub from `GET`, `POST`,
|
|
|
242
242
|
url, and several other locations. Does not currently recurse into the full
|
|
243
243
|
payload.
|
|
244
244
|
|
|
245
|
+
If set to `[:scrub_all]` it will scrub all fields. It will not scrub anything
|
|
246
|
+
that is in the scrub_whitelist configuration array even if :scrub_all is true.
|
|
247
|
+
|
|
248
|
+
### scrub_whitelist
|
|
249
|
+
|
|
250
|
+
Set the list of fields to be whitelisted when `scrub_fields` is set to `[:scrub_all]`.
|
|
251
|
+
|
|
252
|
+
Supports regex entries for partial matching e.g. `[:foo, /\A.+_id\z/, :bar]`
|
|
253
|
+
|
|
245
254
|
### scrub_user
|
|
246
255
|
|
|
247
256
|
**Default** `true`
|
data/gemfiles/rails30.gemfile
CHANGED
|
@@ -2,6 +2,13 @@ require 'rubygems/version'
|
|
|
2
2
|
|
|
3
3
|
source 'https://rubygems.org'
|
|
4
4
|
|
|
5
|
+
# Used by spec/commands/rollbar_rails_runner_spec, and can be used whenever a
|
|
6
|
+
# new process is created during tests. (Testing rake tasks, for example.)
|
|
7
|
+
# This is a workaround for ENV['BUNDLE_GEMFILE'] not working as expected on Travis.
|
|
8
|
+
# We use the ||= assignment because Travis loads the gemfile twice, the second time
|
|
9
|
+
# with the wrong gemfile path.
|
|
10
|
+
ENV['CURRENT_GEMFILE'] ||= __FILE__
|
|
11
|
+
|
|
5
12
|
is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_ENGINE)
|
|
6
13
|
|
|
7
14
|
gem 'sqlite3', '< 1.4.0', :platform => [:ruby, :mswin, :mingw]
|
data/gemfiles/rails31.gemfile
CHANGED
|
@@ -2,6 +2,13 @@ require 'rubygems/version'
|
|
|
2
2
|
|
|
3
3
|
source 'https://rubygems.org'
|
|
4
4
|
|
|
5
|
+
# Used by spec/commands/rollbar_rails_runner_spec, and can be used whenever a
|
|
6
|
+
# new process is created during tests. (Testing rake tasks, for example.)
|
|
7
|
+
# This is a workaround for ENV['BUNDLE_GEMFILE'] not working as expected on Travis.
|
|
8
|
+
# We use the ||= assignment because Travis loads the gemfile twice, the second time
|
|
9
|
+
# with the wrong gemfile path.
|
|
10
|
+
ENV['CURRENT_GEMFILE'] ||= __FILE__
|
|
11
|
+
|
|
5
12
|
is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_ENGINE)
|
|
6
13
|
|
|
7
14
|
gem 'sqlite3', '< 1.4.0', :platform => [:ruby, :mswin, :mingw]
|
data/gemfiles/rails32.gemfile
CHANGED
|
@@ -2,6 +2,13 @@ require 'rubygems/version'
|
|
|
2
2
|
|
|
3
3
|
source 'https://rubygems.org'
|
|
4
4
|
|
|
5
|
+
# Used by spec/commands/rollbar_rails_runner_spec, and can be used whenever a
|
|
6
|
+
# new process is created during tests. (Testing rake tasks, for example.)
|
|
7
|
+
# This is a workaround for ENV['BUNDLE_GEMFILE'] not working as expected on Travis.
|
|
8
|
+
# We use the ||= assignment because Travis loads the gemfile twice, the second time
|
|
9
|
+
# with the wrong gemfile path.
|
|
10
|
+
ENV['CURRENT_GEMFILE'] ||= __FILE__
|
|
11
|
+
|
|
5
12
|
is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_ENGINE)
|
|
6
13
|
|
|
7
14
|
gem 'appraisal'
|
data/gemfiles/rails40.gemfile
CHANGED
|
@@ -2,6 +2,13 @@ require 'rubygems/version'
|
|
|
2
2
|
|
|
3
3
|
source 'https://rubygems.org'
|
|
4
4
|
|
|
5
|
+
# Used by spec/commands/rollbar_rails_runner_spec, and can be used whenever a
|
|
6
|
+
# new process is created during tests. (Testing rake tasks, for example.)
|
|
7
|
+
# This is a workaround for ENV['BUNDLE_GEMFILE'] not working as expected on Travis.
|
|
8
|
+
# We use the ||= assignment because Travis loads the gemfile twice, the second time
|
|
9
|
+
# with the wrong gemfile path.
|
|
10
|
+
ENV['CURRENT_GEMFILE'] ||= __FILE__
|
|
11
|
+
|
|
5
12
|
is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_ENGINE)
|
|
6
13
|
|
|
7
14
|
gem 'appraisal'
|
data/gemfiles/rails41.gemfile
CHANGED
|
@@ -2,6 +2,13 @@ require 'rubygems/version'
|
|
|
2
2
|
|
|
3
3
|
source 'https://rubygems.org'
|
|
4
4
|
|
|
5
|
+
# Used by spec/commands/rollbar_rails_runner_spec, and can be used whenever a
|
|
6
|
+
# new process is created during tests. (Testing rake tasks, for example.)
|
|
7
|
+
# This is a workaround for ENV['BUNDLE_GEMFILE'] not working as expected on Travis.
|
|
8
|
+
# We use the ||= assignment because Travis loads the gemfile twice, the second time
|
|
9
|
+
# with the wrong gemfile path.
|
|
10
|
+
ENV['CURRENT_GEMFILE'] ||= __FILE__
|
|
11
|
+
|
|
5
12
|
is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_ENGINE)
|
|
6
13
|
|
|
7
14
|
gem 'appraisal'
|
data/gemfiles/rails42.gemfile
CHANGED
|
@@ -2,6 +2,13 @@ require 'rubygems/version'
|
|
|
2
2
|
|
|
3
3
|
source 'https://rubygems.org'
|
|
4
4
|
|
|
5
|
+
# Used by spec/commands/rollbar_rails_runner_spec, and can be used whenever a
|
|
6
|
+
# new process is created during tests. (Testing rake tasks, for example.)
|
|
7
|
+
# This is a workaround for ENV['BUNDLE_GEMFILE'] not working as expected on Travis.
|
|
8
|
+
# We use the ||= assignment because Travis loads the gemfile twice, the second time
|
|
9
|
+
# with the wrong gemfile path.
|
|
10
|
+
ENV['CURRENT_GEMFILE'] ||= __FILE__
|
|
11
|
+
|
|
5
12
|
is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_ENGINE)
|
|
6
13
|
is_not_jruby = !is_jruby
|
|
7
14
|
|
data/gemfiles/rails50.gemfile
CHANGED
|
@@ -2,6 +2,13 @@ require 'rubygems/version'
|
|
|
2
2
|
|
|
3
3
|
source 'https://rubygems.org'
|
|
4
4
|
|
|
5
|
+
# Used by spec/commands/rollbar_rails_runner_spec, and can be used whenever a
|
|
6
|
+
# new process is created during tests. (Testing rake tasks, for example.)
|
|
7
|
+
# This is a workaround for ENV['BUNDLE_GEMFILE'] not working as expected on Travis.
|
|
8
|
+
# We use the ||= assignment because Travis loads the gemfile twice, the second time
|
|
9
|
+
# with the wrong gemfile path.
|
|
10
|
+
ENV['CURRENT_GEMFILE'] ||= __FILE__
|
|
11
|
+
|
|
5
12
|
is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_ENGINE)
|
|
6
13
|
|
|
7
14
|
gem 'appraisal'
|
|
@@ -53,10 +60,14 @@ gem 'database_cleaner'
|
|
|
53
60
|
gem 'delayed_job', :require => false
|
|
54
61
|
gem 'generator_spec'
|
|
55
62
|
gem 'girl_friday', '>= 0.11.1'
|
|
56
|
-
gem 'rspec-command'
|
|
57
63
|
gem 'redis'
|
|
58
64
|
gem 'resque'
|
|
59
65
|
|
|
66
|
+
unless is_jruby
|
|
67
|
+
# JRuby doesn't support fork, which is required for this test helper.
|
|
68
|
+
gem 'rspec-command'
|
|
69
|
+
end
|
|
70
|
+
|
|
60
71
|
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0')
|
|
61
72
|
gem 'mime-types', '< 3.0'
|
|
62
73
|
end
|
data/gemfiles/rails51.gemfile
CHANGED
|
@@ -2,6 +2,13 @@ require 'rubygems/version'
|
|
|
2
2
|
|
|
3
3
|
source 'https://rubygems.org'
|
|
4
4
|
|
|
5
|
+
# Used by spec/commands/rollbar_rails_runner_spec, and can be used whenever a
|
|
6
|
+
# new process is created during tests. (Testing rake tasks, for example.)
|
|
7
|
+
# This is a workaround for ENV['BUNDLE_GEMFILE'] not working as expected on Travis.
|
|
8
|
+
# We use the ||= assignment because Travis loads the gemfile twice, the second time
|
|
9
|
+
# with the wrong gemfile path.
|
|
10
|
+
ENV['CURRENT_GEMFILE'] ||= __FILE__
|
|
11
|
+
|
|
5
12
|
is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_ENGINE)
|
|
6
13
|
|
|
7
14
|
gem 'appraisal'
|
|
@@ -54,10 +61,14 @@ gem 'database_cleaner'
|
|
|
54
61
|
gem 'delayed_job', :require => false
|
|
55
62
|
gem 'generator_spec'
|
|
56
63
|
gem 'girl_friday', '>= 0.11.1'
|
|
57
|
-
gem 'rspec-command'
|
|
58
64
|
gem 'redis'
|
|
59
65
|
gem 'resque'
|
|
60
66
|
|
|
67
|
+
unless is_jruby
|
|
68
|
+
# JRuby doesn't support fork, which is required for this test helper.
|
|
69
|
+
gem 'rspec-command'
|
|
70
|
+
end
|
|
71
|
+
|
|
61
72
|
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0')
|
|
62
73
|
gem 'mime-types', '< 3.0'
|
|
63
74
|
end
|
data/gemfiles/rails52.gemfile
CHANGED
|
@@ -2,6 +2,13 @@ require 'rubygems/version'
|
|
|
2
2
|
|
|
3
3
|
source 'https://rubygems.org'
|
|
4
4
|
|
|
5
|
+
# Used by spec/commands/rollbar_rails_runner_spec, and can be used whenever a
|
|
6
|
+
# new process is created during tests. (Testing rake tasks, for example.)
|
|
7
|
+
# This is a workaround for ENV['BUNDLE_GEMFILE'] not working as expected on Travis.
|
|
8
|
+
# We use the ||= assignment because Travis loads the gemfile twice, the second time
|
|
9
|
+
# with the wrong gemfile path.
|
|
10
|
+
ENV['CURRENT_GEMFILE'] ||= __FILE__
|
|
11
|
+
|
|
5
12
|
is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_ENGINE)
|
|
6
13
|
|
|
7
14
|
gem 'appraisal'
|
|
@@ -47,11 +54,15 @@ gem 'codacy-coverage'
|
|
|
47
54
|
gem 'delayed_job', :require => false
|
|
48
55
|
gem 'generator_spec'
|
|
49
56
|
gem 'girl_friday', '>= 0.11.1'
|
|
50
|
-
gem 'rspec-command'
|
|
51
57
|
gem 'redis'
|
|
52
58
|
gem 'resque'
|
|
53
59
|
gem 'simplecov'
|
|
54
60
|
|
|
61
|
+
unless is_jruby
|
|
62
|
+
# JRuby doesn't support fork, which is required for this test helper.
|
|
63
|
+
gem 'rspec-command'
|
|
64
|
+
end
|
|
65
|
+
|
|
55
66
|
gem 'mime-types'
|
|
56
67
|
|
|
57
68
|
gem 'webmock', :require => false
|
data/lib/rails/rollbar_runner.rb
CHANGED
|
@@ -63,6 +63,9 @@ module Rollbar
|
|
|
63
63
|
attr_reader :send_extra_frame_data
|
|
64
64
|
attr_accessor :use_exception_level_filters_default
|
|
65
65
|
attr_accessor :proxy
|
|
66
|
+
attr_accessor :raise_on_error
|
|
67
|
+
attr_accessor :transmit
|
|
68
|
+
attr_accessor :log_payload
|
|
66
69
|
|
|
67
70
|
attr_reader :project_gem_paths
|
|
68
71
|
|
|
@@ -130,6 +133,9 @@ module Rollbar
|
|
|
130
133
|
@project_gem_paths = []
|
|
131
134
|
@use_exception_level_filters_default = false
|
|
132
135
|
@proxy = nil
|
|
136
|
+
@raise_on_error = false
|
|
137
|
+
@transmit = true
|
|
138
|
+
@log_payload = false
|
|
133
139
|
@collect_user_ip = true
|
|
134
140
|
@anonymize_user_ip = false
|
|
135
141
|
@hooks = {
|
|
@@ -270,7 +276,11 @@ module Rollbar
|
|
|
270
276
|
end
|
|
271
277
|
|
|
272
278
|
def logger_level=(level)
|
|
273
|
-
@logger_level = level
|
|
279
|
+
@logger_level = if level
|
|
280
|
+
level.to_sym
|
|
281
|
+
else
|
|
282
|
+
level
|
|
283
|
+
end
|
|
274
284
|
end
|
|
275
285
|
|
|
276
286
|
def logger
|
data/lib/rollbar/item.rb
CHANGED
|
@@ -106,25 +106,37 @@ module Rollbar
|
|
|
106
106
|
# Ensure all keys are strings since we can receive the payload inline or
|
|
107
107
|
# from an async handler job, which can be serialized.
|
|
108
108
|
stringified_payload = Util::Hash.deep_stringify_keys(payload)
|
|
109
|
-
|
|
109
|
+
attempts = []
|
|
110
|
+
result = Truncation.truncate(stringified_payload, attempts)
|
|
110
111
|
|
|
111
112
|
return result unless Truncation.truncate?(result)
|
|
112
113
|
|
|
113
|
-
handle_too_large_payload(stringified_payload, result)
|
|
114
|
+
handle_too_large_payload(stringified_payload, result, attempts)
|
|
114
115
|
|
|
115
116
|
nil
|
|
116
117
|
end
|
|
117
118
|
|
|
118
|
-
def handle_too_large_payload(stringified_payload, final_payload)
|
|
119
|
-
original_size = Rollbar::JSON.dump(stringified_payload).bytesize
|
|
120
|
-
final_size = final_payload.bytesize
|
|
119
|
+
def handle_too_large_payload(stringified_payload, final_payload, attempts)
|
|
121
120
|
uuid = stringified_payload['data']['uuid']
|
|
122
121
|
host = stringified_payload['data'].fetch('server', {})['host']
|
|
123
122
|
|
|
124
|
-
notifier.send_failsafe(
|
|
123
|
+
notifier.send_failsafe(
|
|
124
|
+
too_large_payload_string(stringified_payload, final_payload, attempts),
|
|
125
|
+
nil,
|
|
126
|
+
uuid,
|
|
127
|
+
host
|
|
128
|
+
)
|
|
125
129
|
logger.error("[Rollbar] Payload too large to be sent for UUID #{uuid}: #{Rollbar::JSON.dump(payload)}")
|
|
126
130
|
end
|
|
127
131
|
|
|
132
|
+
def too_large_payload_string(stringified_payload, final_payload, attempts)
|
|
133
|
+
original_size = Rollbar::JSON.dump(stringified_payload).bytesize
|
|
134
|
+
final_size = final_payload.bytesize
|
|
135
|
+
|
|
136
|
+
'Could not send payload due to it being too large after truncating attempts. ' \
|
|
137
|
+
"Original size: #{original_size} Attempts: #{attempts.join(', ')} Final size: #{final_size}"
|
|
138
|
+
end
|
|
139
|
+
|
|
128
140
|
def ignored?
|
|
129
141
|
data = payload['data']
|
|
130
142
|
|
data/lib/rollbar/logger_proxy.rb
CHANGED
|
@@ -36,7 +36,11 @@ module Rollbar
|
|
|
36
36
|
def acceptable_levels
|
|
37
37
|
@acceptable_levels ||= begin
|
|
38
38
|
levels = [:debug, :info, :warn, :error]
|
|
39
|
-
|
|
39
|
+
if Rollbar.configuration.logger_level
|
|
40
|
+
levels[levels.find_index(Rollbar.configuration.logger_level)..-1]
|
|
41
|
+
else
|
|
42
|
+
[]
|
|
43
|
+
end
|
|
40
44
|
end
|
|
41
45
|
end
|
|
42
46
|
end
|
data/lib/rollbar/notifier.rb
CHANGED
|
@@ -147,13 +147,19 @@ module Rollbar
|
|
|
147
147
|
level = lookup_exception_level(level, exception,
|
|
148
148
|
use_exception_level_filters)
|
|
149
149
|
|
|
150
|
-
|
|
151
|
-
report(level, message, exception, extra, context)
|
|
152
|
-
rescue StandardError, SystemStackError => e
|
|
153
|
-
report_internal_error(e)
|
|
150
|
+
ret = report_with_rescue(level, message, exception, extra, context)
|
|
154
151
|
|
|
155
|
-
|
|
156
|
-
|
|
152
|
+
raise(exception) if configuration.raise_on_error && exception
|
|
153
|
+
|
|
154
|
+
ret
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
def report_with_rescue(level, message, exception, extra, context)
|
|
158
|
+
report(level, message, exception, extra, context)
|
|
159
|
+
rescue StandardError, SystemStackError => e
|
|
160
|
+
report_internal_error(e)
|
|
161
|
+
|
|
162
|
+
'error'
|
|
157
163
|
end
|
|
158
164
|
|
|
159
165
|
# See log() above
|
|
@@ -429,15 +435,24 @@ module Rollbar
|
|
|
429
435
|
|
|
430
436
|
return 'ignored' if item.ignored?
|
|
431
437
|
|
|
432
|
-
schedule_item(item)
|
|
438
|
+
schedule_item(item) if configuration.transmit
|
|
439
|
+
|
|
440
|
+
log_and_return_item_data(item)
|
|
441
|
+
end
|
|
433
442
|
|
|
443
|
+
def log_and_return_item_data(item)
|
|
434
444
|
data = item['data']
|
|
435
445
|
log_instance_link(data)
|
|
436
446
|
Rollbar.last_report = data
|
|
447
|
+
log_data(data) if configuration.log_payload
|
|
437
448
|
|
|
438
449
|
data
|
|
439
450
|
end
|
|
440
451
|
|
|
452
|
+
def log_data(data)
|
|
453
|
+
log_info "[Rollbar] Data: #{data}"
|
|
454
|
+
end
|
|
455
|
+
|
|
441
456
|
# Reports an internal error in the Rollbar library. This will be reported within the configured
|
|
442
457
|
# Rollbar project. We'll first attempt to provide a report including the exception traceback.
|
|
443
458
|
# If that fails, we'll fall back to a more static failsafe response.
|
|
@@ -208,8 +208,10 @@ module Rollbar
|
|
|
208
208
|
end
|
|
209
209
|
|
|
210
210
|
def json_request?(rack_req)
|
|
211
|
-
|
|
212
|
-
|
|
211
|
+
json_regex = /\bjson\b/
|
|
212
|
+
|
|
213
|
+
!!(rack_req.env['CONTENT_TYPE'] =~ json_regex ||
|
|
214
|
+
rack_req.env['HTTP_ACCEPT'] =~ json_regex)
|
|
213
215
|
end
|
|
214
216
|
|
|
215
217
|
def rollbar_route_params(env)
|
|
@@ -52,10 +52,10 @@ module Rollbar
|
|
|
52
52
|
end
|
|
53
53
|
|
|
54
54
|
def build_whitelist_regex(whitelist)
|
|
55
|
-
fields = whitelist.find_all { |f| f.is_a?(String) || f.is_a?(Symbol) }
|
|
55
|
+
fields = whitelist.find_all { |f| f.is_a?(String) || f.is_a?(Symbol) || f.is_a?(Regexp) }
|
|
56
56
|
return unless fields.any?
|
|
57
57
|
|
|
58
|
-
Regexp.new(fields.map { |val| /\A#{Regexp.escape(val.to_s)}\z/ }.join('|'))
|
|
58
|
+
Regexp.new(fields.map { |val| val.is_a?(Regexp) ? val : /\A#{Regexp.escape(val.to_s)}\z/ }.join('|'))
|
|
59
59
|
end
|
|
60
60
|
|
|
61
61
|
def scrub(params, options)
|
data/lib/rollbar/truncation.rb
CHANGED
|
@@ -15,11 +15,12 @@ module Rollbar
|
|
|
15
15
|
StringsStrategy,
|
|
16
16
|
MinBodyStrategy].freeze
|
|
17
17
|
|
|
18
|
-
def self.truncate(payload)
|
|
18
|
+
def self.truncate(payload, attempts = [])
|
|
19
19
|
result = nil
|
|
20
20
|
|
|
21
21
|
STRATEGIES.each do |strategy|
|
|
22
22
|
result = strategy.call(payload)
|
|
23
|
+
attempts << result.bytesize
|
|
23
24
|
break unless truncate?(result)
|
|
24
25
|
end
|
|
25
26
|
|
data/lib/rollbar/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rollbar
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.20.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rollbar, Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-
|
|
11
|
+
date: 2019-05-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: multi_json
|
|
@@ -169,7 +169,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
169
169
|
- !ruby/object:Gem::Version
|
|
170
170
|
version: '0'
|
|
171
171
|
requirements: []
|
|
172
|
-
|
|
172
|
+
rubyforge_project:
|
|
173
|
+
rubygems_version: 2.7.7
|
|
173
174
|
signing_key:
|
|
174
175
|
specification_version: 4
|
|
175
176
|
summary: Reports exceptions to Rollbar
|