rollbar 2.19.1 → 2.27.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/pull_request_template.md +25 -0
- data/.rubocop.yml +168 -0
- data/.travis.yml +63 -34
- data/Appraisals +10 -10
- data/Gemfile +35 -14
- data/README.md +5 -2
- data/Rakefile +0 -0
- data/data/rollbar.snippet.js +1 -1
- data/docs/configuration.md +17 -0
- data/gemfiles/rails30.gemfile +10 -10
- data/gemfiles/rails31.gemfile +10 -9
- data/gemfiles/rails32.gemfile +10 -9
- data/gemfiles/rails40.gemfile +10 -9
- data/gemfiles/rails41.gemfile +10 -9
- data/gemfiles/rails42.gemfile +12 -9
- data/gemfiles/rails50.gemfile +21 -14
- data/gemfiles/rails51.gemfile +21 -14
- data/gemfiles/rails52.gemfile +15 -12
- data/gemfiles/rails60.gemfile +67 -0
- data/lib/generators/rollbar/rollbar_generator.rb +1 -1
- data/lib/rails/rollbar_runner.rb +4 -2
- data/lib/rollbar/capistrano.rb +1 -1
- data/lib/rollbar/capistrano3.rb +6 -3
- data/lib/rollbar/capistrano_tasks.rb +29 -21
- data/lib/rollbar/configuration.rb +86 -16
- data/lib/rollbar/delay/girl_friday.rb +4 -8
- data/lib/rollbar/delay/resque.rb +3 -6
- data/lib/rollbar/delay/sidekiq.rb +4 -10
- data/lib/rollbar/delay/sucker_punch.rb +16 -19
- data/lib/rollbar/delay/thread.rb +16 -2
- data/lib/rollbar/deploy.rb +52 -29
- data/lib/rollbar/encoding/encoder.rb +17 -10
- data/lib/rollbar/exception_reporter.rb +19 -5
- data/lib/rollbar/item/backtrace.rb +13 -3
- data/lib/rollbar/item/frame.rb +9 -1
- data/lib/rollbar/item/locals.rb +100 -0
- data/lib/rollbar/item.rb +56 -17
- data/lib/rollbar/json.rb +6 -51
- data/lib/rollbar/language_support.rb +4 -20
- data/lib/rollbar/lazy_store.rb +5 -5
- data/lib/rollbar/logger.rb +1 -0
- data/lib/rollbar/logger_proxy.rb +6 -2
- data/lib/rollbar/middleware/js.rb +28 -18
- data/lib/rollbar/middleware/rack.rb +4 -1
- data/lib/rollbar/middleware/rails/rollbar.rb +10 -1
- data/lib/rollbar/notifier/trace_with_bindings.rb +65 -0
- data/lib/rollbar/notifier.rb +225 -89
- data/lib/rollbar/plugin.rb +54 -6
- data/lib/rollbar/plugins/active_job.rb +6 -2
- data/lib/rollbar/plugins/basic_socket.rb +21 -6
- data/lib/rollbar/plugins/delayed_job/job_data.rb +3 -3
- data/lib/rollbar/plugins/delayed_job/plugin.rb +13 -3
- data/lib/rollbar/plugins/error_context.rb +11 -0
- data/lib/rollbar/plugins/goalie.rb +11 -3
- data/lib/rollbar/plugins/rails/controller_methods.rb +15 -3
- data/lib/rollbar/plugins/rake.rb +2 -2
- data/lib/rollbar/plugins/sidekiq/plugin.rb +5 -4
- data/lib/rollbar/plugins.rb +7 -1
- data/lib/rollbar/rake_tasks.rb +4 -148
- data/lib/rollbar/request_data_extractor.rb +31 -21
- data/lib/rollbar/rollbar_test.rb +36 -0
- data/lib/rollbar/scrubbers/params.rb +19 -18
- data/lib/rollbar/scrubbers/url.rb +18 -9
- data/lib/rollbar/scrubbers.rb +3 -3
- data/lib/rollbar/truncation/frames_strategy.rb +1 -1
- data/lib/rollbar/truncation/min_body_strategy.rb +2 -3
- data/lib/rollbar/truncation/mixin.rb +1 -1
- data/lib/rollbar/truncation/remove_any_key_strategy.rb +123 -0
- data/lib/rollbar/truncation/remove_extra_strategy.rb +35 -0
- data/lib/rollbar/truncation/remove_request_strategy.rb +21 -0
- data/lib/rollbar/truncation/strings_strategy.rb +6 -5
- data/lib/rollbar/truncation.rb +9 -2
- data/lib/rollbar/util/hash.rb +15 -0
- data/lib/rollbar/util/ip_anonymizer.rb +8 -7
- data/lib/rollbar/util/ip_obfuscator.rb +1 -1
- data/lib/rollbar/util.rb +6 -2
- data/lib/rollbar/version.rb +1 -1
- data/lib/rollbar.rb +2 -3
- data/lib/tasks/benchmark.rake +103 -0
- data/rollbar.gemspec +13 -5
- data/spec/support/rollbar_api.rb +67 -0
- metadata +21 -23
- data/gemfiles/ruby_1_8_and_1_9_2.gemfile +0 -49
- data/lib/rollbar/json/default.rb +0 -11
- data/lib/rollbar/json/oj.rb +0 -16
@@ -17,12 +17,15 @@ module Rollbar
|
|
17
17
|
|
18
18
|
Rollbar.scoped(fetch_scope(env)) do
|
19
19
|
begin
|
20
|
+
Rollbar.notifier.enable_locals
|
20
21
|
response = @app.call(env)
|
21
22
|
report_exception_to_rollbar(env, framework_error(env)) if framework_error(env)
|
22
23
|
response
|
23
24
|
rescue Exception => e
|
24
25
|
report_exception_to_rollbar(env, e)
|
25
26
|
raise
|
27
|
+
ensure
|
28
|
+
Rollbar.notifier.disable_locals
|
26
29
|
end
|
27
30
|
end
|
28
31
|
end
|
@@ -41,7 +44,7 @@ module Rollbar
|
|
41
44
|
proc { extract_person_data_from_controller(env) }
|
42
45
|
end
|
43
46
|
|
44
|
-
def framework_error(
|
47
|
+
def framework_error(_env)
|
45
48
|
nil
|
46
49
|
end
|
47
50
|
end
|
@@ -21,6 +21,7 @@ module Rollbar
|
|
21
21
|
|
22
22
|
Rollbar.scoped(scope) do
|
23
23
|
begin
|
24
|
+
Rollbar.notifier.enable_locals
|
24
25
|
response = @app.call(env)
|
25
26
|
|
26
27
|
if (framework_exception = env['action_dispatch.exception'])
|
@@ -31,6 +32,8 @@ module Rollbar
|
|
31
32
|
rescue Exception => exception
|
32
33
|
report_exception_to_rollbar(env, exception)
|
33
34
|
raise
|
35
|
+
ensure
|
36
|
+
Rollbar.notifier.disable_locals
|
34
37
|
end
|
35
38
|
end
|
36
39
|
end
|
@@ -62,7 +65,13 @@ module Rollbar
|
|
62
65
|
block = proc { extract_person_data_from_controller(env) }
|
63
66
|
return block unless defined?(ActiveRecord::Base) && ActiveRecord::Base.connected?
|
64
67
|
|
65
|
-
proc
|
68
|
+
proc do
|
69
|
+
begin
|
70
|
+
ActiveRecord::Base.connection_pool.with_connection(&block)
|
71
|
+
rescue ActiveRecord::ConnectionTimeoutError
|
72
|
+
{}
|
73
|
+
end
|
74
|
+
end
|
66
75
|
end
|
67
76
|
|
68
77
|
def context(request_data)
|
@@ -0,0 +1,65 @@
|
|
1
|
+
module Rollbar
|
2
|
+
class Notifier
|
3
|
+
class TraceWithBindings # :nodoc:
|
4
|
+
attr_reader :frames, :exception_frames
|
5
|
+
|
6
|
+
def initialize
|
7
|
+
reset
|
8
|
+
end
|
9
|
+
|
10
|
+
def reset
|
11
|
+
@frames = []
|
12
|
+
@exception_frames = []
|
13
|
+
@exception_signature = nil
|
14
|
+
end
|
15
|
+
|
16
|
+
def enable
|
17
|
+
reset
|
18
|
+
trace_point.enable if defined?(TracePoint)
|
19
|
+
end
|
20
|
+
|
21
|
+
def disable
|
22
|
+
trace_point.disable if defined?(TracePoint)
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def exception_signature(trace)
|
28
|
+
# use the exception backtrace to detect reraised exception.
|
29
|
+
trace.raised_exception.backtrace.first
|
30
|
+
end
|
31
|
+
|
32
|
+
def detect_reraise(trace)
|
33
|
+
@exception_signature == exception_signature(trace)
|
34
|
+
end
|
35
|
+
|
36
|
+
def trace_point
|
37
|
+
return unless defined?(TracePoint)
|
38
|
+
|
39
|
+
@trace_point ||= TracePoint.new(:call, :return, :b_call, :b_return, :c_call, :c_return, :raise) do |tp|
|
40
|
+
case tp.event
|
41
|
+
when :call, :b_call, :c_call, :class
|
42
|
+
frames.push frame(tp)
|
43
|
+
when :return, :b_return, :c_return, :end
|
44
|
+
frames.pop
|
45
|
+
when :raise
|
46
|
+
unless detect_reraise(tp) # ignore reraised exceptions
|
47
|
+
@exception_frames = @frames.dup # may be possible to optimize better than #dup
|
48
|
+
@exception_signature = exception_signature(tp)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def frame(trace)
|
55
|
+
{
|
56
|
+
:binding => trace.binding,
|
57
|
+
:defined_class => trace.defined_class,
|
58
|
+
:method_id => trace.method_id,
|
59
|
+
:path => trace.path,
|
60
|
+
:lineno => trace.lineno
|
61
|
+
}
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|