rollbar 2.11.4 → 2.11.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +15 -4
- data/lib/rollbar.rb +9 -2
- data/lib/rollbar/plugins/rake.rb +1 -0
- data/lib/rollbar/plugins/sidekiq.rb +2 -0
- data/lib/rollbar/plugins/validations.rb +2 -2
- data/lib/rollbar/version.rb +1 -1
- data/spec/rollbar/item_spec.rb +21 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6edb7fcbd4c4ffc66f2451d062c827adefd22616
|
4
|
+
data.tar.gz: 601ce3760bb0f43db2ccd5be4ab277675ff1df59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db4d227277234a877903b5c3516667428526449ca113da5703c242dce1c44156d494d8eaf5a7c01a2015c3443b2ac31e4ea89dac36cef0f992cd81bac28cb0bb
|
7
|
+
data.tar.gz: a3965fdadc10b602b0d8f721bea94924f5f183ec3d346cc8dcab996d916ac13e816d38340ea8f9797dcae8d4468b80532a9f6e2318fb7c450b5c10f46ef35542
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
Bugfixes:
|
4
|
+
|
5
|
+
- Use require_dependency for rake and sidekiq plugins. See [#485](https://github.com/rollbar/rollbar-gem/pull/485).
|
6
|
+
- Add immediate ActiveModel::Validations monkey patch. See [#484](https://github.com/rollbar/rollbar-gem/pull/484).
|
7
|
+
- Pass correct options to Item.build_with. See [#480](https://github.com/rollbar/rollbar-gem/pull/480).
|
8
|
+
|
9
|
+
Documentation:
|
10
|
+
|
11
|
+
- Update exception filter heading and TOC. See [#481](https://github.com/rollbar/rollbar-gem/pull/481).
|
12
|
+
- Add advanced usage of exception filters in readme. See [#477](https://github.com/rollbar/rollbar-gem/pull/477).
|
13
|
+
|
14
|
+
|
3
15
|
## 2.11.4
|
4
16
|
|
5
17
|
Change:
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Rollbar [![Build Status](https://api.travis-ci.org/rollbar/rollbar-gem.svg?branch=v2.11.
|
1
|
+
# Rollbar [![Build Status](https://api.travis-ci.org/rollbar/rollbar-gem.svg?branch=v2.11.5)](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.
|
@@ -26,6 +26,7 @@ This is the Ruby library for Rollbar. It will instrument many kinds of Ruby appl
|
|
26
26
|
- [Data sanitization (scrubbing)](#data-sanitization-scrubbing)
|
27
27
|
- [Including additional runtime data](#including-additional-runtime-data)
|
28
28
|
- [Exception level filters](#exception-level-filters)
|
29
|
+
- [Dyanmic levels](#dynamic-levels)
|
29
30
|
- [Before process hook](#before-process-hook)
|
30
31
|
- [Transform hook](#transform-hook)
|
31
32
|
- [The Scope](#the-scope)
|
@@ -501,7 +502,17 @@ This behavior applies to uncaught exceptions, not direct calls to `Rollbar.error
|
|
501
502
|
Rollbar.error(exception, :use_exception_level_filters => true)
|
502
503
|
```
|
503
504
|
|
504
|
-
|
505
|
+
### Dynamic levels
|
506
|
+
|
507
|
+
You can also specify a callable object (any object that responds to `call`) which will be called with the exception instance. For example, you can have a single error reported at different levels using the following code:
|
508
|
+
|
509
|
+
```ruby
|
510
|
+
config.exception_level_filters.merge!({
|
511
|
+
'SomeError' => lambda { |error| error.to_s.include?('not serious enough') ? 'info' : 'error' }
|
512
|
+
})
|
513
|
+
```
|
514
|
+
|
515
|
+
## Before process hook
|
505
516
|
|
506
517
|
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:
|
507
518
|
|
@@ -523,7 +534,7 @@ Rollbar.configure do |config|
|
|
523
534
|
end
|
524
535
|
```
|
525
536
|
|
526
|
-
##
|
537
|
+
## Transform hook
|
527
538
|
|
528
539
|
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:
|
529
540
|
|
@@ -548,7 +559,7 @@ Rollbar.configure do |config|
|
|
548
559
|
end
|
549
560
|
```
|
550
561
|
|
551
|
-
##
|
562
|
+
## The Scope
|
552
563
|
|
553
564
|
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:
|
554
565
|
|
data/lib/rollbar.rb
CHANGED
@@ -221,7 +221,10 @@ module Rollbar
|
|
221
221
|
def process_from_async_handler(payload)
|
222
222
|
payload = Rollbar::JSON.load(payload) if payload.is_a?(String)
|
223
223
|
|
224
|
-
item = Item.build_with(payload
|
224
|
+
item = Item.build_with(payload,
|
225
|
+
:notifier => self,
|
226
|
+
:configuration => configuration,
|
227
|
+
:logger => logger)
|
225
228
|
|
226
229
|
Rollbar.silenced do
|
227
230
|
begin
|
@@ -263,7 +266,11 @@ module Rollbar
|
|
263
266
|
}
|
264
267
|
|
265
268
|
begin
|
266
|
-
|
269
|
+
item = Item.build_with(failsafe_payload,
|
270
|
+
:notifier => self,
|
271
|
+
:configuration => configuration,
|
272
|
+
:logger => logger)
|
273
|
+
schedule_item(item)
|
267
274
|
rescue => e
|
268
275
|
log_error "[Rollbar] Error sending failsafe : #{e}"
|
269
276
|
end
|
data/lib/rollbar/plugins/rake.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
Rollbar.plugins.define('sidekiq >= 3') do
|
2
|
+
require_dependency('sidekiq')
|
2
3
|
dependency { !configuration.disable_monkey_patch }
|
3
4
|
dependency { defined?(Sidekiq) }
|
4
5
|
dependency { Sidekiq::VERSION.split('.')[0].to_i >= 3 }
|
@@ -19,6 +20,7 @@ Rollbar.plugins.define('sidekiq >= 3') do
|
|
19
20
|
end
|
20
21
|
|
21
22
|
Rollbar.plugins.define('sidekiq < 3') do
|
23
|
+
require_dependency('sidekiq')
|
22
24
|
dependency { !configuration.disable_monkey_patch }
|
23
25
|
dependency { defined?(Sidekiq) }
|
24
26
|
dependency { Sidekiq::VERSION.split('.')[0].to_i < 3 }
|
@@ -7,7 +7,7 @@ Rollbar.plugins.define('active_model') do
|
|
7
7
|
ActiveModel::VERSION::MAJOR >= 3
|
8
8
|
end
|
9
9
|
|
10
|
-
execute do
|
10
|
+
execute! do
|
11
11
|
module Rollbar
|
12
12
|
# Module that defines methods to be used by instances using
|
13
13
|
# ActiveModel::Validations
|
@@ -25,7 +25,7 @@ Rollbar.plugins.define('active_model') do
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
execute do
|
28
|
+
execute! do
|
29
29
|
ActiveModel::Validations.module_eval do
|
30
30
|
include Rollbar::ActiveRecordExtension
|
31
31
|
end
|
data/lib/rollbar/version.rb
CHANGED
data/spec/rollbar/item_spec.rb
CHANGED
@@ -631,5 +631,26 @@ describe Rollbar::Item do
|
|
631
631
|
expect(json).to be_kind_of(String)
|
632
632
|
end
|
633
633
|
end
|
634
|
+
|
635
|
+
context 'with too large payload', :fixture => :payload do
|
636
|
+
let(:payload_fixture) { 'payloads/sample.trace.json' }
|
637
|
+
let(:item) do
|
638
|
+
Rollbar::Item.build_with(payload,
|
639
|
+
:notifier => notifier,
|
640
|
+
:configuration => configuration,
|
641
|
+
:logger => logger)
|
642
|
+
end
|
643
|
+
|
644
|
+
before do
|
645
|
+
allow(Rollbar::Truncation).to receive(:truncate?).and_return(true)
|
646
|
+
end
|
647
|
+
|
648
|
+
it 'calls Notifier#send_failsafe and logs the error' do
|
649
|
+
expect(notifier).to receive(:send_failsafe)
|
650
|
+
expect(logger).to receive(:error)
|
651
|
+
|
652
|
+
item.dump
|
653
|
+
end
|
654
|
+
end
|
634
655
|
end
|
635
656
|
end
|
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.11.
|
4
|
+
version: 2.11.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rollbar, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|