rollbar 0.12.15 → 0.12.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5bbaf8de3eae319898938c1c8a2f98c1b30250da
4
- data.tar.gz: 09c007792c1a7f50ea1f6a397eb37b35e1eb9475
3
+ metadata.gz: 3130e2b2d1b3c726cbca30e0a4e8da37ee7dca3e
4
+ data.tar.gz: 8eebb4ee086cf014aeaac40b1ca1fc2077c32c05
5
5
  SHA512:
6
- metadata.gz: 8f71aa48757390584c2570ddb9ab96f65dd7c15cde0ba29577c7259f882cec89df23adcfffbaed4a6a47c8962d3e752ac7626c82760649e2d1dc2295b7347057
7
- data.tar.gz: 74279a5b7c505f722d7c6b865869f5ff98ed9bb0add957e35e53b06cbb35c04745a0e8b32e49ea3e7396b6438c8c635bb9c83e7f1530cd7a6caa1f535bf63b79
6
+ metadata.gz: 5a41834e01227318af18e5255d911af94388897c683c6d63a789937a8d57b747417d9a0305ed563d4de4c506b0b4348c1a15d7abf6ce6d389ad458191f9697a9
7
+ data.tar.gz: f5137b1973af0fb0766e91f11e741de5965697c67915335104e54f82d05da029964dcdabb46285dbf11c13beb88d70710747b01b146c18640864493984661419
@@ -24,40 +24,57 @@ matrix:
24
24
  exclude:
25
25
  - rvm: 1.8.7
26
26
  gemfile: gemfiles/rails40.gemfile
27
+ - rvm: 1.8.7
28
+ gemfile: gemfiles/rails41.gemfile
27
29
  - rvm: 1.9.2
28
30
  gemfile: gemfiles/rails40.gemfile
31
+ - rvm: 1.9.2
32
+ gemfile: gemfiles/rails41.gemfile
33
+ - rvm: 1.9.3
34
+ gemfile: gemfiles/rails41.gemfile
29
35
  - rvm: ruby-head
30
36
  gemfile: gemfiles/rails30.gemfile
31
37
  - rvm: ruby-head
32
38
  gemfile: gemfiles/rails31.gemfile
33
39
  - rvm: ruby-head
34
40
  gemfile: gemfiles/rails40.gemfile
41
+ - rvm: ruby-head
42
+ gemfile: gemfiles/rails41.gemfile
35
43
  - rvm: jruby-18mode
36
44
  gemfile: gemfiles/rails30.gemfile
37
45
  - rvm: jruby-18mode
38
46
  gemfile: gemfiles/rails31.gemfile
39
47
  - rvm: jruby-18mode
40
48
  gemfile: gemfiles/rails40.gemfile
49
+ - rvm: jruby-18mode
50
+ gemfile: gemfiles/rails41.gemfile
41
51
  - rvm: jruby-19mode
42
52
  gemfile: gemfiles/rails30.gemfile
43
53
  - rvm: jruby-19mode
44
54
  gemfile: gemfiles/rails31.gemfile
45
55
  - rvm: jruby-19mode
46
56
  gemfile: gemfiles/rails40.gemfile
57
+ - rvm: jruby-19mode
58
+ gemfile: gemfiles/rails41.gemfile
47
59
  - rvm: jruby-head
48
60
  gemfile: gemfiles/rails30.gemfile
49
61
  - rvm: jruby-head
50
62
  gemfile: gemfiles/rails31.gemfile
51
63
  - rvm: jruby-head
52
64
  gemfile: gemfiles/rails40.gemfile
65
+ - rvm: jruby-head
66
+ gemfile: gemfiles/rails41.gemfile
53
67
  - rvm: rbx
54
68
  gemfile: gemfiles/rails30.gemfile
55
69
  - rvm: rbx
56
70
  gemfile: gemfiles/rails31.gemfile
57
71
  - rvm: rbx
58
72
  gemfile: gemfiles/rails40.gemfile
73
+ - rvm: rbx
74
+ gemfile: gemfiles/rails41.gemfile
59
75
  gemfile:
60
76
  - gemfiles/rails30.gemfile
61
77
  - gemfiles/rails31.gemfile
62
78
  - gemfiles/rails32.gemfile
63
79
  - gemfiles/rails40.gemfile
80
+ - gemfiles/rails41.gemfile
data/Appraisals CHANGED
@@ -7,9 +7,13 @@ appraise "rails31" do
7
7
  end
8
8
 
9
9
  appraise "rails32" do
10
- gem "rails", "3.2.12"
10
+ gem "rails", "3.2.17"
11
11
  end
12
12
 
13
13
  appraise "rails40" do
14
- gem "rails", "4.0.0"
14
+ gem "rails", "4.0.4"
15
+ end
16
+
17
+ appraise "rails41" do
18
+ gem "rails", "4.1.0"
15
19
  end
@@ -1,5 +1,13 @@
1
1
  # Change Log
2
2
 
3
+ **0.12.16**
4
+ - Scrub fields are now converted to a regular expression for broader param name matching
5
+ - Save ActionDispatch request_id in reports if present
6
+ - Added proper Sidekiq 3 error handler
7
+ - Removed usage of ActiveSupport's `Object#try` in different areas of the notifier
8
+ - Added a configurable request timeout for reports (defaults to 3 seconds)
9
+ - Fix circular json exception handling in Rails 4.1
10
+
3
11
  **0.12.15**
4
12
  - Send X-Rollbar-Access-Token http header along with payloads
5
13
 
data/README.md CHANGED
@@ -216,7 +216,7 @@ Rollbar.silenced {
216
216
 
217
217
  ## Delayed::Job integration
218
218
 
219
- If `delayed_job` is defined, Rollbar will automatically install a handler that reports any uncaught exceptions that occur in jobs.
219
+ If `delayed_job` is defined, Rollbar will automatically install a plugin that reports any uncaught exceptions that occur in jobs.
220
220
 
221
221
  By default, the job's data will be included in the report. If you want to disable this functionality to prevent sensitive data from possibly being sent, use the following configuration option:
222
222
 
@@ -230,6 +230,11 @@ You can also change the threshold of job retries that must occur before a job is
230
230
  config.dj_threshold = 2 # default is 0
231
231
  ```
232
232
 
233
+ If you use [custom jobs](https://github.com/collectiveidea/delayed_job#custom-jobs) that define their own hooks to report exceptions, please consider disabling our plugin. Not doing so will result in duplicate exceptions being reported as well as lack of control when exceptions should be reported. To disable our Delayed::Job plugin, add the following line after the `Rollbar.configure` block.
234
+
235
+ ```ruby
236
+ Delayed::Worker.plugins.delete(Delayed::Plugins::Rollbar)
237
+ ```
233
238
 
234
239
 
235
240
  ## Asynchronous reporting
data/THANKS.md CHANGED
@@ -20,9 +20,11 @@ Huge thanks to the following contributors (by github username). For the most up-
20
20
  - [kavu](https://github.com/kavu)
21
21
  - [magnolia-fan](https://github.com/magnolia-fan)
22
22
  - [mauricio](https://github.com/mauricio)
23
+ - [metaskills](https://github.com/metaskills)
23
24
  - [miloops](https://github.com/miloops)
24
25
  - [mipearson](https://github.com/mipearson)
25
26
  - [petergoldstein](https://github.com/petergoldstein)
27
+ - [pmen](https://github.com/pmen)
26
28
  - [rogercampos](https://github.com/rogercampos)
27
29
  - [siong1987](https://github.com/siong1987)
28
30
  - [trisweb](https://github.com/trisweb)
@@ -2,15 +2,15 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "sqlite3", :platform=>[:ruby, :mswin, :mingw]
6
- gem "jruby-openssl", :platform=>:jruby
7
- gem "activerecord-jdbcsqlite3-adapter", :platform=>:jruby
5
+ gem "sqlite3", :platform => [:ruby, :mswin, :mingw]
6
+ gem "jruby-openssl", :platform => :jruby
7
+ gem "activerecord-jdbcsqlite3-adapter", :platform => :jruby
8
8
  gem "appraisal"
9
- gem "rubysl", "~> 2.0", :platform=>:rbx
10
- gem "racc", :platform=>:rbx
11
- gem "minitest", :platform=>:rbx
12
- gem "rubysl-test-unit", :platform=>:rbx
13
- gem "rubinius-developer_tools", :platform=>:rbx
9
+ gem "rubysl", "~> 2.0", :platform => :rbx
10
+ gem "racc", :platform => :rbx
11
+ gem "minitest", :platform => :rbx
12
+ gem "rubysl-test-unit", :platform => :rbx
13
+ gem "rubinius-developer_tools", :platform => :rbx
14
14
  gem "rails", "3.0.20"
15
15
 
16
- gemspec :path=>"../"
16
+ gemspec :path => "../"
@@ -2,15 +2,15 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "sqlite3", :platform=>[:ruby, :mswin, :mingw]
6
- gem "jruby-openssl", :platform=>:jruby
7
- gem "activerecord-jdbcsqlite3-adapter", :platform=>:jruby
5
+ gem "sqlite3", :platform => [:ruby, :mswin, :mingw]
6
+ gem "jruby-openssl", :platform => :jruby
7
+ gem "activerecord-jdbcsqlite3-adapter", :platform => :jruby
8
8
  gem "appraisal"
9
- gem "rubysl", "~> 2.0", :platform=>:rbx
10
- gem "racc", :platform=>:rbx
11
- gem "minitest", :platform=>:rbx
12
- gem "rubysl-test-unit", :platform=>:rbx
13
- gem "rubinius-developer_tools", :platform=>:rbx
9
+ gem "rubysl", "~> 2.0", :platform => :rbx
10
+ gem "racc", :platform => :rbx
11
+ gem "minitest", :platform => :rbx
12
+ gem "rubysl-test-unit", :platform => :rbx
13
+ gem "rubinius-developer_tools", :platform => :rbx
14
14
  gem "rails", "3.1.12"
15
15
 
16
- gemspec :path=>"../"
16
+ gemspec :path => "../"
@@ -2,15 +2,15 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "sqlite3", :platform=>[:ruby, :mswin, :mingw]
6
- gem "jruby-openssl", :platform=>:jruby
7
- gem "activerecord-jdbcsqlite3-adapter", :platform=>:jruby
5
+ gem "sqlite3", :platform => [:ruby, :mswin, :mingw]
6
+ gem "jruby-openssl", :platform => :jruby
7
+ gem "activerecord-jdbcsqlite3-adapter", :platform => :jruby
8
8
  gem "appraisal"
9
- gem "rubysl", "~> 2.0", :platform=>:rbx
10
- gem "racc", :platform=>:rbx
11
- gem "minitest", :platform=>:rbx
12
- gem "rubysl-test-unit", :platform=>:rbx
13
- gem "rubinius-developer_tools", :platform=>:rbx
14
- gem "rails", "3.2.12"
9
+ gem "rubysl", "~> 2.0", :platform => :rbx
10
+ gem "racc", :platform => :rbx
11
+ gem "minitest", :platform => :rbx
12
+ gem "rubysl-test-unit", :platform => :rbx
13
+ gem "rubinius-developer_tools", :platform => :rbx
14
+ gem "rails", "3.2.17"
15
15
 
16
- gemspec :path=>"../"
16
+ gemspec :path => "../"
@@ -2,15 +2,15 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "sqlite3", :platform=>[:ruby, :mswin, :mingw]
6
- gem "jruby-openssl", :platform=>:jruby
7
- gem "activerecord-jdbcsqlite3-adapter", :platform=>:jruby
5
+ gem "sqlite3", :platform => [:ruby, :mswin, :mingw]
6
+ gem "jruby-openssl", :platform => :jruby
7
+ gem "activerecord-jdbcsqlite3-adapter", :platform => :jruby
8
8
  gem "appraisal"
9
- gem "rubysl", "~> 2.0", :platform=>:rbx
10
- gem "racc", :platform=>:rbx
11
- gem "minitest", :platform=>:rbx
12
- gem "rubysl-test-unit", :platform=>:rbx
13
- gem "rubinius-developer_tools", :platform=>:rbx
14
- gem "rails", "4.0.0"
9
+ gem "rubysl", "~> 2.0", :platform => :rbx
10
+ gem "racc", :platform => :rbx
11
+ gem "minitest", :platform => :rbx
12
+ gem "rubysl-test-unit", :platform => :rbx
13
+ gem "rubinius-developer_tools", :platform => :rbx
14
+ gem "rails", "4.0.4"
15
15
 
16
- gemspec :path=>"../"
16
+ gemspec :path => "../"
@@ -0,0 +1,15 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "sqlite3", :platform => [:ruby, :mswin, :mingw]
6
+ gem "jruby-openssl", :platform => :jruby
7
+ gem "activerecord-jdbcsqlite3-adapter", :platform => :jruby
8
+ gem "appraisal"
9
+ gem "rubysl", "~> 2.0", :platform => :rbx
10
+ gem "racc", :platform => :rbx
11
+ gem "minitest", :platform => :rbx
12
+ gem "rubinius-developer_tools", :platform => :rbx
13
+ gem "rails", "4.1.0"
14
+
15
+ gemspec :path => "../"
@@ -96,7 +96,7 @@ module Rollbar
96
96
  schedule_payload(payload)
97
97
  log_instance_link(data)
98
98
  data
99
- rescue => e
99
+ rescue Exception => e
100
100
  report_internal_error(e)
101
101
  'error'
102
102
  end
@@ -123,7 +123,7 @@ module Rollbar
123
123
  schedule_payload(payload)
124
124
  log_instance_link(data)
125
125
  data
126
- rescue => e
126
+ rescue Exception => e
127
127
  report_internal_error(e)
128
128
  'error'
129
129
  end
@@ -349,6 +349,7 @@ module Rollbar
349
349
  end
350
350
  uri = URI.parse(configuration.endpoint)
351
351
  http = Net::HTTP.new(uri.host, uri.port)
352
+ http.read_timeout = configuration.request_timeout
352
353
 
353
354
  if uri.scheme == 'https'
354
355
  http.use_ssl = true
@@ -13,8 +13,8 @@ module BetterErrors
13
13
  exception_data = nil
14
14
  begin
15
15
  controller = env['action_controller.instance']
16
- request_data = controller.try(:rollbar_request_data)
17
- person_data = controller.try(:rollbar_person_data)
16
+ request_data = controller.rollbar_request_data rescue nil
17
+ person_data = controller.rollbar_person_data rescue nil
18
18
  exception_data = Rollbar.report_exception(exception, request_data, person_data)
19
19
  rescue => e
20
20
  # TODO use logger here?
@@ -23,6 +23,7 @@ module Rollbar
23
23
  attr_accessor :person_username_method
24
24
  attr_accessor :person_email_method
25
25
  attr_accessor :report_dj_data
26
+ attr_accessor :request_timeout
26
27
  attr_accessor :root
27
28
  attr_accessor :scrub_fields
28
29
  attr_accessor :scrub_headers
@@ -58,6 +59,7 @@ module Rollbar
58
59
  @person_email_method = 'email'
59
60
  @project_gems = []
60
61
  @report_dj_data = true
62
+ @request_timeout = 3
61
63
  @scrub_fields = [:passwd, :password, :password_confirmation, :secret,
62
64
  :confirm_password, :password_confirmation, :secret_token]
63
65
  @scrub_headers = ['Authorization']
@@ -3,7 +3,7 @@ module Rollbar
3
3
  include RequestDataExtractor
4
4
 
5
5
  def report_exception_to_rollbar(env, exception)
6
- rollbar_debug "[Rollbar] Reporting exception: #{exception.try(:message)}", :error
6
+ rollbar_debug "[Rollbar] Reporting exception: #{exception.message}", :error
7
7
  request_data = extract_request_data_from_rack(env)
8
8
  person_data = extract_person_data_from_controller(env)
9
9
  exception_data = Rollbar.report_exception(exception, request_data, person_data)
@@ -17,7 +17,7 @@ module Rollbar
17
17
  rollbar_debug "[Rollbar] Exception not reported because it was ignored"
18
18
  end
19
19
  rescue => e
20
- rollbar_debug "[Rollbar] Exception while reporting exception to Rollbar: #{e.try(:message)}"
20
+ rollbar_debug "[Rollbar] Exception while reporting exception to Rollbar: #{e.message}"
21
21
  end
22
22
 
23
23
  def rollbar_debug(message, level = :debug)
@@ -8,8 +8,8 @@ module Goalie
8
8
  exception_data = nil
9
9
  begin
10
10
  controller = env['action_controller.instance']
11
- request_data = controller.try(:rollbar_request_data)
12
- person_data = controller.try(:rollbar_person_data)
11
+ request_data = controller.rollbar_request_data rescue nil
12
+ person_data = controller.rollbar_person_data rescue nil
13
13
  exception_data = Rollbar.report_exception(exception, request_data, person_data)
14
14
  rescue => e
15
15
  # TODO use logger here?
@@ -10,7 +10,7 @@ module Rollbar
10
10
  person_data = env['rollbar.person_data'] || {}
11
11
  else
12
12
  controller = env['action_controller.instance']
13
- person_data = controller ? controller.try(:rollbar_person_data) : {}
13
+ person_data = controller.rollbar_person_data rescue {}
14
14
  end
15
15
 
16
16
  person_data
@@ -29,7 +29,7 @@ module Rollbar
29
29
 
30
30
  params = request_params.merge(get_params).merge(post_params)
31
31
 
32
- {
32
+ data = {
33
33
  :params => params,
34
34
  :url => rollbar_url(env),
35
35
  :user_ip => rollbar_user_ip(env),
@@ -37,8 +37,14 @@ module Rollbar
37
37
  :cookies => cookies,
38
38
  :session => session,
39
39
  :method => rollbar_request_method(env),
40
- :route => route_params
40
+ :route => route_params,
41
41
  }
42
+
43
+ if env["action_dispatch.request_id"]
44
+ data[:request_id] = env["action_dispatch.request_id"]
45
+ end
46
+
47
+ data
42
48
  end
43
49
 
44
50
  private
@@ -119,14 +125,18 @@ module Rollbar
119
125
  end
120
126
 
121
127
  def rollbar_filtered_params(sensitive_params, params)
128
+ @sensitive_params_regexp ||= Regexp.new(sensitive_params.map{ |val| Regexp.escape(val.to_s).to_s }.join('|'), true)
129
+
122
130
  if params.nil?
123
131
  {}
124
132
  else
125
133
  params.to_hash.inject({}) do |result, (key, value)|
126
- if sensitive_params.include?(key.to_sym)
134
+ if @sensitive_params_regexp =~ key.to_s
127
135
  result[key] = rollbar_scrubbed(value)
128
136
  elsif value.is_a?(Hash)
129
137
  result[key] = rollbar_filtered_params(sensitive_params, value)
138
+ elsif value.is_a?(Array)
139
+ result[key] = value.map {|v| v.is_a?(Hash) ? rollbar_filtered_params(sensitive_params, v) : v}
130
140
  elsif ATTACHMENT_CLASSES.include?(value.class.name)
131
141
  result[key] = {
132
142
  :content_type => value.content_type,
@@ -1,25 +1,38 @@
1
1
  # encoding: utf-8
2
2
 
3
- module Rollbar
4
- class Sidekiq
5
- def call(worker, msg, queue)
6
- begin
7
- yield
8
- rescue Exception => e
9
- msg.delete('backtrace')
10
- msg.delete('error_backtrace')
11
- msg.delete('error_message')
12
- msg.delete('error_class')
3
+ if Sidekiq::VERSION < '3'
4
+ module Rollbar
5
+ class Sidekiq
6
+ def call(worker, msg, queue)
7
+ begin
8
+ yield
9
+ rescue Exception => e
10
+ msg.delete('backtrace')
11
+ msg.delete('error_backtrace')
12
+ msg.delete('error_message')
13
+ msg.delete('error_class')
13
14
 
14
- Rollbar.report_exception(e, :params => msg)
15
- raise
15
+ Rollbar.report_exception(e, :params => msg)
16
+ raise
17
+ end
16
18
  end
17
19
  end
18
20
  end
19
- end
20
21
 
21
- Sidekiq.configure_server do |config|
22
- config.server_middleware do |chain|
23
- chain.add Rollbar::Sidekiq
22
+ Sidekiq.configure_server do |config|
23
+ config.server_middleware do |chain|
24
+ chain.add Rollbar::Sidekiq
25
+ end
26
+ end
27
+ else
28
+ Sidekiq.configure_server do |config|
29
+ config.error_handlers << Proc.new do |e, context|
30
+ context.delete('backtrace')
31
+ context.delete('error_backtrace')
32
+ context.delete('error_message')
33
+ context.delete('error_class')
34
+
35
+ Rollbar.report_exception(e, :params => context)
36
+ end
24
37
  end
25
38
  end
@@ -1,3 +1,3 @@
1
1
  module Rollbar
2
- VERSION = "0.12.15"
2
+ VERSION = "0.12.16"
3
3
  end
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
18
18
  gem.add_runtime_dependency 'multi_json', '~> 1.3'
19
19
 
20
20
  gem.add_development_dependency 'rails', '>= 3.0.0'
21
- gem.add_development_dependency 'rspec-rails', '~> 2.12.0'
21
+ gem.add_development_dependency 'rspec-rails', '>= 2.14.0'
22
22
  gem.add_development_dependency 'database_cleaner', '~> 1.0.0'
23
23
  gem.add_development_dependency 'girl_friday', '>= 0.11.1'
24
24
  gem.add_development_dependency 'sucker_punch', '>= 1.0.0' if RUBY_VERSION != '1.8.7'
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: 0.12.15
4
+ version: 0.12.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Rue
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-18 00:00:00.000000000 Z
11
+ date: 2014-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: rspec-rails
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
- version: 2.12.0
47
+ version: 2.14.0
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
- version: 2.12.0
54
+ version: 2.14.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: database_cleaner
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -143,6 +143,7 @@ files:
143
143
  - gemfiles/rails31.gemfile
144
144
  - gemfiles/rails32.gemfile
145
145
  - gemfiles/rails40.gemfile
146
+ - gemfiles/rails41.gemfile
146
147
  - lib/generators/rollbar/rollbar_generator.rb
147
148
  - lib/generators/rollbar/templates/initializer.rb
148
149
  - lib/rollbar.rb