airbrake 11.0.0 → 12.0.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/lib/airbrake/delayed_job.rb +28 -30
- data/lib/airbrake/logger.rb +3 -1
- data/lib/airbrake/rack/context_filter.rb +10 -6
- data/lib/airbrake/rack/instrumentable.rb +4 -0
- data/lib/airbrake/rack/route_filter.rb +1 -1
- data/lib/airbrake/rails/action_cable.rb +19 -17
- data/lib/airbrake/rails/http.rb +12 -8
- data/lib/airbrake/rails.rb +6 -8
- data/lib/airbrake/rake.rb +47 -46
- data/lib/airbrake/resque.rb +26 -25
- data/lib/airbrake/shoryuken.rb +2 -4
- data/lib/airbrake/sidekiq.rb +3 -5
- data/lib/airbrake/sneakers.rb +27 -27
- data/lib/airbrake/version.rb +1 -1
- data/lib/generators/airbrake_generator.rb +3 -6
- data/lib/generators/airbrake_initializer.rb.erb +65 -65
- metadata +25 -39
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c85c0e09edeb08efee5cabc43e11d56a02fb9cacbb2c0e415b81d0effa3f27b1
|
4
|
+
data.tar.gz: e6c403b7219e58f8e296f9a2dddc510a6749b651e52569b995db6ff8b5e71b86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be4e1cffdf8560bc786970f5db60fd6a85961a55ea7d5f1c87533ef338d30a0f462909879977b91e3d921f4ed4b3b616ca0fcdbcc4d18c0c5ccb01841b00be5d
|
7
|
+
data.tar.gz: 28c44be64dd701b8afbf286b3dbced4756b6132b807ffc00e8a89c269d91b5e6b268a5e983e87b50fc00a524bc8a71f8e6a5da15bd7d385ce0a0f9d6d141b623
|
data/lib/airbrake/delayed_job.rb
CHANGED
@@ -7,41 +7,39 @@ module Delayed
|
|
7
7
|
class Airbrake < ::Delayed::Plugin
|
8
8
|
callbacks do |lifecycle|
|
9
9
|
lifecycle.around(:invoke_job) do |job, *args, &block|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
params = job.as_json
|
10
|
+
timing = ::Airbrake::Benchmark.measure do
|
11
|
+
# Forward the call to the next callback in the callback chain
|
12
|
+
block.call(job, *args)
|
13
|
+
end
|
14
|
+
rescue Exception => exception # rubocop:disable Lint/RescueException
|
15
|
+
params = job.as_json
|
17
16
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
17
|
+
# If DelayedJob is used through ActiveJob, it contains extra info.
|
18
|
+
if job.payload_object.respond_to?(:job_data)
|
19
|
+
params[:active_job] = job.payload_object.job_data
|
20
|
+
job_class = job.payload_object.job_data['job_class']
|
21
|
+
end
|
23
22
|
|
24
|
-
|
23
|
+
action = job_class || job.payload_object.class.name
|
25
24
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
25
|
+
::Airbrake.notify(exception, params) do |notice|
|
26
|
+
notice[:context][:component] = 'delayed_job'
|
27
|
+
notice[:context][:action] = action
|
28
|
+
end
|
30
29
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
30
|
+
::Airbrake.notify_queue(
|
31
|
+
queue: action,
|
32
|
+
error_count: 1,
|
33
|
+
timing: 0.01,
|
34
|
+
)
|
36
35
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
end
|
36
|
+
raise exception
|
37
|
+
else
|
38
|
+
::Airbrake.notify_queue(
|
39
|
+
queue: job_class || job.payload_object.class.name,
|
40
|
+
error_count: 0,
|
41
|
+
timing: timing,
|
42
|
+
)
|
45
43
|
end
|
46
44
|
end
|
47
45
|
end
|
data/lib/airbrake/logger.rb
CHANGED
@@ -9,7 +9,7 @@ module Airbrake
|
|
9
9
|
#
|
10
10
|
# @example
|
11
11
|
# # Create a logger like you normally do and decorate it.
|
12
|
-
# logger = Airbrake::AirbrakeLogger.new(Logger.new(
|
12
|
+
# logger = Airbrake::AirbrakeLogger.new(Logger.new($stdout))
|
13
13
|
#
|
14
14
|
# # Just use the logger like you normally do.
|
15
15
|
# logger.fatal('oops')
|
@@ -24,6 +24,8 @@ module Airbrake
|
|
24
24
|
attr_reader :airbrake_level
|
25
25
|
|
26
26
|
def initialize(logger)
|
27
|
+
super
|
28
|
+
|
27
29
|
__setobj__(logger)
|
28
30
|
@airbrake_notifier = Airbrake
|
29
31
|
self.level = logger.level
|
@@ -20,14 +20,9 @@ module Airbrake
|
|
20
20
|
context = notice[:context]
|
21
21
|
|
22
22
|
context[:url] = request.url
|
23
|
-
context[:userAddr] =
|
24
|
-
if request.respond_to?(:remote_ip)
|
25
|
-
request.remote_ip
|
26
|
-
else
|
27
|
-
request.ip
|
28
|
-
end
|
29
23
|
context[:userAgent] = request.user_agent
|
30
24
|
|
25
|
+
add_ip(context, request)
|
31
26
|
add_framework_version(context)
|
32
27
|
|
33
28
|
controller = request.env['action_controller.instance']
|
@@ -60,6 +55,15 @@ module Airbrake
|
|
60
55
|
}
|
61
56
|
end
|
62
57
|
end
|
58
|
+
|
59
|
+
def add_ip(context, request)
|
60
|
+
context[:userAddr] =
|
61
|
+
if request.respond_to?(:remote_ip)
|
62
|
+
request.remote_ip
|
63
|
+
else
|
64
|
+
request.ip
|
65
|
+
end
|
66
|
+
end
|
63
67
|
end
|
64
68
|
end
|
65
69
|
end
|
@@ -57,6 +57,7 @@ module Airbrake
|
|
57
57
|
klass.module_exec do
|
58
58
|
mod = __airbrake_capture_timing_module__
|
59
59
|
mod.module_exec do
|
60
|
+
# rubocop:disable Style/DocumentDynamicEvalDefinition
|
60
61
|
module_eval <<-RUBY, __FILE__, __LINE__ + 1
|
61
62
|
def #{method_name}(#{args})
|
62
63
|
Airbrake::Rack.capture_timing(#{label.to_s.inspect}) do
|
@@ -65,6 +66,7 @@ module Airbrake
|
|
65
66
|
end
|
66
67
|
#{visibility} :#{method_name}
|
67
68
|
RUBY
|
69
|
+
# rubocop:enable Style/DocumentDynamicEvalDefinition
|
68
70
|
end
|
69
71
|
prepend mod
|
70
72
|
end
|
@@ -83,6 +85,7 @@ module Airbrake
|
|
83
85
|
klass.module_exec do
|
84
86
|
alias_method wrapped_method_name, method_name
|
85
87
|
remove_method method_name if needs_removal
|
88
|
+
# rubocop:disable Style/DocumentDynamicEvalDefinition
|
86
89
|
module_eval <<-RUBY, __FILE__, __LINE__ + 1
|
87
90
|
def #{method_name}(#{args})
|
88
91
|
Airbrake::Rack.capture_timing(#{label.to_s.inspect}) do
|
@@ -91,6 +94,7 @@ module Airbrake
|
|
91
94
|
end
|
92
95
|
#{visibility} :#{method_name}
|
93
96
|
RUBY
|
97
|
+
# rubocop:enable Style/DocumentDynamicEvalDefinition
|
94
98
|
end
|
95
99
|
end
|
96
100
|
|
@@ -10,26 +10,28 @@ require 'airbrake/rails/action_cable/notify_callback'
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
module
|
14
|
-
module
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
13
|
+
module Airbrake
|
14
|
+
module ActionCable
|
15
|
+
module Channel
|
16
|
+
# @since v8.3.0
|
17
|
+
# @api private
|
18
|
+
# @see https://github.com/rails/rails/blob/master/actioncable/lib/action_cable/channel/base.rb
|
19
|
+
module Base
|
20
|
+
def perform_action(*args, &block)
|
21
|
+
super(*args, &block)
|
22
|
+
rescue Exception => ex # rubocop:disable Lint/RescueException
|
23
|
+
Airbrake.notify(ex) do |notice|
|
24
|
+
notice.stash[:action_cable_connection] = connection
|
25
|
+
notice[:context][:component] = self.class
|
26
|
+
notice[:context][:action] = args.first['action']
|
27
|
+
notice[:params].merge!(args.first)
|
28
|
+
end
|
20
29
|
|
21
|
-
|
22
|
-
perform_action_without_airbrake(*args, &block)
|
23
|
-
rescue Exception => ex # rubocop:disable Lint/RescueException
|
24
|
-
Airbrake.notify(ex) do |notice|
|
25
|
-
notice.stash[:action_cable_connection] = connection
|
26
|
-
notice[:context][:component] = self.class
|
27
|
-
notice[:context][:action] = args.first['action']
|
28
|
-
notice[:params].merge!(args.first)
|
30
|
+
raise ex
|
29
31
|
end
|
30
|
-
|
31
|
-
raise ex
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
36
|
+
|
37
|
+
ActionCable::Channel::Base.prepend(Airbrake::ActionCable::Channel::Base)
|
data/lib/airbrake/rails/http.rb
CHANGED
@@ -1,14 +1,18 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
module
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
3
|
+
module Airbrake
|
4
|
+
module Rails
|
5
|
+
# Monkey-patch to measure request timing.
|
6
|
+
# @api private
|
7
|
+
# @since v11.0.2
|
8
|
+
module HTTP
|
9
|
+
def perform(request, options)
|
10
|
+
Airbrake::Rack.capture_timing(:http) do
|
11
|
+
super(request, options)
|
12
|
+
end
|
11
13
|
end
|
12
14
|
end
|
13
15
|
end
|
14
16
|
end
|
17
|
+
|
18
|
+
HTTP::Client.prepend(Airbrake::Rails::HTTP)
|
data/lib/airbrake/rails.rb
CHANGED
@@ -6,16 +6,14 @@ module Airbrake
|
|
6
6
|
# Rails namespace holds all Rails-related functionality.
|
7
7
|
module Rails
|
8
8
|
def self.logger
|
9
|
+
# Rails.logger is not set in some Rake tasks such as
|
10
|
+
# 'airbrake:deploy'. In this case we use a sensible fallback.
|
11
|
+
level = (::Rails.logger ? ::Rails.logger.level : Logger::ERROR)
|
12
|
+
|
9
13
|
if ENV['RAILS_LOG_TO_STDOUT'].present?
|
10
|
-
Logger.new(
|
14
|
+
Logger.new($stdout, level: level)
|
11
15
|
else
|
12
|
-
Logger.new(
|
13
|
-
::Rails.root.join('log', 'airbrake.log'),
|
14
|
-
|
15
|
-
# Rails.logger is not set in some Rake tasks such as
|
16
|
-
# 'airbrake:deploy'. In this case we use a sensible fallback.
|
17
|
-
level: (::Rails.logger ? ::Rails.logger.level : Logger::ERROR),
|
18
|
-
)
|
16
|
+
Logger.new(::Rails.root.join('log', 'airbrake.log'), level: level)
|
19
17
|
end
|
20
18
|
end
|
21
19
|
end
|
data/lib/airbrake/rake.rb
CHANGED
@@ -5,61 +5,62 @@
|
|
5
5
|
# See: https://goo.gl/ksn6PE
|
6
6
|
Rake::TaskManager.record_task_metadata = true
|
7
7
|
|
8
|
-
module
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
end
|
24
|
-
# rubocop:enable Lint/RescueException
|
8
|
+
module Airbrake
|
9
|
+
module Rake
|
10
|
+
# Redefine +Rake::Task#execute+, so it can report errors to Airbrake.
|
11
|
+
module Task
|
12
|
+
# A wrapper around the original +#execute+, that catches all errors and
|
13
|
+
# notifies Airbrake.
|
14
|
+
#
|
15
|
+
# rubocop:disable Lint/RescueException
|
16
|
+
def execute(args = nil)
|
17
|
+
super(args)
|
18
|
+
rescue Exception => ex
|
19
|
+
notify_airbrake(ex, args)
|
20
|
+
raise ex
|
21
|
+
end
|
22
|
+
# rubocop:enable Lint/RescueException
|
25
23
|
|
26
|
-
|
24
|
+
private
|
27
25
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
26
|
+
def notify_airbrake(exception, args)
|
27
|
+
notice = Airbrake.build_notice(exception)
|
28
|
+
notice[:context][:component] = 'rake'
|
29
|
+
notice[:context][:action] = name
|
30
|
+
notice[:params].merge!(
|
31
|
+
rake_task: task_info,
|
32
|
+
execute_args: args,
|
33
|
+
argv: ARGV.join(' '),
|
34
|
+
)
|
37
35
|
|
38
|
-
|
39
|
-
|
36
|
+
Airbrake.notify_sync(notice)
|
37
|
+
end
|
40
38
|
|
41
|
-
|
42
|
-
|
43
|
-
|
39
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize
|
40
|
+
def task_info
|
41
|
+
info = {}
|
44
42
|
|
45
|
-
|
46
|
-
|
47
|
-
|
43
|
+
info[:name] = name
|
44
|
+
info[:timestamp] = timestamp.to_s
|
45
|
+
info[:investigation] = investigation
|
48
46
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
47
|
+
info[:full_comment] = full_comment if full_comment
|
48
|
+
info[:arg_names] = arg_names if arg_names.any?
|
49
|
+
info[:arg_description] = arg_description if arg_description
|
50
|
+
info[:locations] = locations if locations.any?
|
51
|
+
info[:sources] = sources if sources.any?
|
54
52
|
|
55
|
-
|
56
|
-
|
57
|
-
|
53
|
+
if prerequisite_tasks.any?
|
54
|
+
info[:prerequisite_tasks] = prerequisite_tasks.map do |p|
|
55
|
+
p.__send__(:task_info)
|
56
|
+
end
|
58
57
|
end
|
59
|
-
end
|
60
58
|
|
61
|
-
|
59
|
+
info
|
60
|
+
end
|
61
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize
|
62
62
|
end
|
63
|
-
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize
|
64
63
|
end
|
65
64
|
end
|
65
|
+
|
66
|
+
Rake::Task.prepend(Airbrake::Rake::Task)
|
data/lib/airbrake/resque.rb
CHANGED
@@ -30,32 +30,33 @@ module Resque
|
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
-
module
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
33
|
+
module Airbrake
|
34
|
+
module Resque
|
35
|
+
# Measures elapsed time of a job and notifies Airbrake of the execution
|
36
|
+
# status.
|
37
|
+
#
|
38
|
+
# @since v9.6.0
|
39
|
+
module Job
|
40
|
+
def perform
|
41
|
+
timing = Airbrake::Benchmark.measure do
|
42
|
+
super
|
43
|
+
end
|
44
|
+
rescue StandardError => exception
|
45
|
+
Airbrake.notify_queue_sync(
|
46
|
+
queue: payload['class'],
|
47
|
+
error_count: 1,
|
48
|
+
timing: 0.01,
|
49
|
+
)
|
50
|
+
raise exception
|
51
|
+
else
|
52
|
+
Airbrake.notify_queue_sync(
|
53
|
+
queue: payload['class'],
|
54
|
+
error_count: 0,
|
55
|
+
timing: timing,
|
56
|
+
)
|
45
57
|
end
|
46
|
-
rescue StandardError => exception
|
47
|
-
Airbrake.notify_queue_sync(
|
48
|
-
queue: payload['class'],
|
49
|
-
error_count: 1,
|
50
|
-
timing: 0.01,
|
51
|
-
)
|
52
|
-
raise exception
|
53
|
-
else
|
54
|
-
Airbrake.notify_queue_sync(
|
55
|
-
queue: payload['class'],
|
56
|
-
error_count: 0,
|
57
|
-
timing: timing,
|
58
|
-
)
|
59
58
|
end
|
60
59
|
end
|
61
60
|
end
|
61
|
+
|
62
|
+
Resque::Job.prepend(Airbrake::Resque::Job)
|
data/lib/airbrake/shoryuken.rb
CHANGED
@@ -5,10 +5,8 @@ module Airbrake
|
|
5
5
|
# Provides integration with Shoryuken.
|
6
6
|
class ErrorHandler
|
7
7
|
# rubocop:disable Lint/RescueException
|
8
|
-
def call(worker, queue, _sqs_msg, body)
|
9
|
-
timing = Airbrake::Benchmark.measure
|
10
|
-
yield
|
11
|
-
end
|
8
|
+
def call(worker, queue, _sqs_msg, body, &block)
|
9
|
+
timing = Airbrake::Benchmark.measure(&block)
|
12
10
|
rescue Exception => exception
|
13
11
|
notify_airbrake(exception, worker, queue, body)
|
14
12
|
Airbrake.notify_queue(
|
data/lib/airbrake/sidekiq.rb
CHANGED
@@ -6,10 +6,8 @@ module Airbrake
|
|
6
6
|
module Sidekiq
|
7
7
|
# Provides integration with Sidekiq v2+.
|
8
8
|
class ErrorHandler
|
9
|
-
def call(_worker, context, _queue)
|
10
|
-
timing = Airbrake::Benchmark.measure
|
11
|
-
yield
|
12
|
-
end
|
9
|
+
def call(_worker, context, _queue, &block)
|
10
|
+
timing = Airbrake::Benchmark.measure(&block)
|
13
11
|
rescue Exception => exception # rubocop:disable Lint/RescueException
|
14
12
|
notify_airbrake(exception, context)
|
15
13
|
Airbrake.notify_queue(
|
@@ -38,7 +36,7 @@ module Airbrake
|
|
38
36
|
# @return [String] job's name. When ActiveJob is present, retrieve
|
39
37
|
# job_class. When used directly, use worker's name
|
40
38
|
def action(context)
|
41
|
-
klass = context['class'] || context[:job] && context[:job]['class']
|
39
|
+
klass = context['class'] || (context[:job] && context[:job]['class'])
|
42
40
|
return klass unless context[:job] && context[:job]['args'].first.is_a?(Hash)
|
43
41
|
return klass unless (job_class = context[:job]['args'].first['job_class'])
|
44
42
|
|
data/lib/airbrake/sneakers.rb
CHANGED
@@ -39,34 +39,34 @@ end
|
|
39
39
|
|
40
40
|
Sneakers.error_reporters << Airbrake::Sneakers::ErrorReporter.new
|
41
41
|
|
42
|
-
module
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
42
|
+
module Airbrake
|
43
|
+
module Sneakers
|
44
|
+
# @todo Migrate to Sneakers v2.12.0 middleware API when it's released
|
45
|
+
# @see https://github.com/jondot/sneakers/pull/364
|
46
|
+
module Worker
|
47
|
+
# Sneakers v2.7.0+ renamed `do_work` to `process_work`.
|
48
|
+
define_method(
|
49
|
+
::Sneakers::Worker.method_defined?(:process_work) ? :process_work : :do_work,
|
50
|
+
) do |delivery_info, metadata, msg, handler|
|
51
|
+
timing = Airbrake::Benchmark.measure do
|
52
|
+
super(delivery_info, metadata, msg, handler)
|
53
|
+
end
|
54
|
+
rescue Exception => exception # rubocop:disable Lint/RescueException
|
55
|
+
Airbrake.notify_queue(
|
56
|
+
queue: self.class.to_s,
|
57
|
+
error_count: 1,
|
58
|
+
timing: 0.01,
|
59
|
+
)
|
60
|
+
raise exception
|
61
|
+
else
|
62
|
+
Airbrake.notify_queue(
|
63
|
+
queue: self.class.to_s,
|
64
|
+
error_count: 0,
|
65
|
+
timing: timing,
|
66
|
+
)
|
56
67
|
end
|
57
|
-
rescue Exception => exception # rubocop:disable Lint/RescueException
|
58
|
-
Airbrake.notify_queue(
|
59
|
-
queue: self.class.to_s,
|
60
|
-
error_count: 1,
|
61
|
-
timing: 0.01,
|
62
|
-
)
|
63
|
-
raise exception
|
64
|
-
else
|
65
|
-
Airbrake.notify_queue(
|
66
|
-
queue: self.class.to_s,
|
67
|
-
error_count: 0,
|
68
|
-
timing: timing,
|
69
|
-
)
|
70
68
|
end
|
71
69
|
end
|
72
70
|
end
|
71
|
+
|
72
|
+
Sneakers::Worker.prepend(Airbrake::Sneakers::Worker)
|
data/lib/airbrake/version.rb
CHANGED
@@ -3,22 +3,19 @@
|
|
3
3
|
# Creates the Airbrake initializer file for Rails apps.
|
4
4
|
#
|
5
5
|
# @example Invokation from terminal
|
6
|
-
# rails generate airbrake
|
6
|
+
# rails generate airbrake [NAME]
|
7
7
|
#
|
8
8
|
class AirbrakeGenerator < Rails::Generators::Base
|
9
9
|
# Adds current directory to source paths, so we can find the template file.
|
10
10
|
source_root File.expand_path(__dir__)
|
11
11
|
|
12
|
-
argument :project_id, required: false
|
13
|
-
argument :project_key, required: false
|
14
|
-
|
15
12
|
# Makes the NAME option optional, which allows to subclass from Base, so we
|
16
13
|
# can pass arguments to the ERB template.
|
17
14
|
#
|
18
|
-
# @see
|
15
|
+
# @see https://asciicasts.com/episodes/218-making-generators-in-rails-3.html
|
19
16
|
argument :name, type: :string, default: 'application'
|
20
17
|
|
21
|
-
desc 'Configures the Airbrake notifier
|
18
|
+
desc 'Configures the Airbrake notifier'
|
22
19
|
def generate_layout
|
23
20
|
template 'airbrake_initializer.rb.erb', 'config/initializers/airbrake.rb'
|
24
21
|
end
|
@@ -1,80 +1,80 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Airbrake is an online tool that provides robust exception tracking in your
|
4
|
-
# applications. In doing so, it allows you to easily review errors, tie an
|
5
|
-
# to an individual piece of code, and trace the cause back to recent
|
6
|
-
# changes. Airbrake enables for easy categorization, searching, and
|
7
|
-
# of exceptions so that when errors occur, your team can quickly
|
8
|
-
# root cause.
|
3
|
+
# Airbrake is an online tool that provides robust exception tracking in your
|
4
|
+
# Rails applications. In doing so, it allows you to easily review errors, tie an
|
5
|
+
# error to an individual piece of code, and trace the cause back to recent
|
6
|
+
# changes. Airbrake enables for easy categorization, searching, and
|
7
|
+
# prioritization of exceptions so that when errors occur, your team can quickly
|
8
|
+
# determine the root cause.
|
9
9
|
#
|
10
10
|
# Configuration details:
|
11
11
|
# https://github.com/airbrake/airbrake-ruby#configuration
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
<% end -%>
|
22
|
-
<% if project_key -%>
|
23
|
-
c.project_key = '<%= project_key %>'
|
24
|
-
<% else -%>
|
25
|
-
c.project_key = ENV['AIRBRAKE_API_KEY']
|
26
|
-
<% end -%>
|
12
|
+
if (project_id = ENV['AIRBRAKE_PROJECT_ID']) &&
|
13
|
+
project_key = (ENV['AIRBRAKE_PROJECT_KEY'] || ENV['AIRBRAKE_API_KEY'])
|
14
|
+
Airbrake.configure do |c|
|
15
|
+
# You must set both project_id & project_key. To find your project_id and
|
16
|
+
# project_key navigate to your project's General Settings and copy the
|
17
|
+
# values from the right sidebar.
|
18
|
+
# https://github.com/airbrake/airbrake-ruby#project_id--project_key
|
19
|
+
c.project_id = project_id
|
20
|
+
c.project_key = project_key
|
27
21
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
22
|
+
# Configures the root directory of your project. Expects a String or a
|
23
|
+
# Pathname, which represents the path to your project. Providing this option
|
24
|
+
# helps us to filter out repetitive data from backtrace frames and link to
|
25
|
+
# GitHub files from our dashboard.
|
26
|
+
# https://github.com/airbrake/airbrake-ruby#root_directory
|
27
|
+
c.root_directory = Rails.root
|
34
28
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
29
|
+
# By default, Airbrake Ruby outputs to STDOUT. In Rails apps it makes sense
|
30
|
+
# to use the Rails' logger.
|
31
|
+
# https://github.com/airbrake/airbrake-ruby#logger
|
32
|
+
c.logger = Airbrake::Rails.logger
|
39
33
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
34
|
+
# Configures the environment the application is running in. Helps the
|
35
|
+
# Airbrake dashboard to distinguish between exceptions occurring in
|
36
|
+
# different environments.
|
37
|
+
# NOTE: This option must be set in order to make the 'ignore_environments'
|
38
|
+
# option work.
|
39
|
+
# https://github.com/airbrake/airbrake-ruby#environment
|
40
|
+
c.environment = Rails.env
|
47
41
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
42
|
+
# Setting this option allows Airbrake to filter exceptions occurring in
|
43
|
+
# unwanted environments such as :test. NOTE: This option *does not* work if
|
44
|
+
# you don't set the 'environment' option.
|
45
|
+
# https://github.com/airbrake/airbrake-ruby#ignore_environments
|
46
|
+
c.ignore_environments = %w[test]
|
53
47
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
48
|
+
# A list of parameters that should be filtered out of what is sent to
|
49
|
+
# Airbrake. By default, all "password" attributes will have their contents
|
50
|
+
# replaced.
|
51
|
+
# https://github.com/airbrake/airbrake-ruby#blocklist_keys
|
52
|
+
c.blocklist_keys = [/password/i, /authorization/i]
|
59
53
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
end
|
54
|
+
# Alternatively, you can integrate with Rails' filter_parameters.
|
55
|
+
# Read more: https://goo.gl/gqQ1xS
|
56
|
+
# c.blocklist_keys = Rails.application.config.filter_parameters
|
57
|
+
end
|
64
58
|
|
65
|
-
# A filter that collects request body information. Enable it if you are sure you
|
66
|
-
# don't send sensitive information to Airbrake in your body (such as passwords).
|
67
|
-
# https://github.com/airbrake/airbrake#requestbodyfilter
|
68
|
-
# Airbrake.add_filter(Airbrake::Rack::RequestBodyFilter.new)
|
59
|
+
# A filter that collects request body information. Enable it if you are sure you
|
60
|
+
# don't send sensitive information to Airbrake in your body (such as passwords).
|
61
|
+
# https://github.com/airbrake/airbrake#requestbodyfilter
|
62
|
+
# Airbrake.add_filter(Airbrake::Rack::RequestBodyFilter.new)
|
69
63
|
|
70
|
-
# Attaches thread & fiber local variables along with general thread information.
|
71
|
-
# Airbrake.add_filter(Airbrake::Filters::ThreadFilter.new)
|
64
|
+
# Attaches thread & fiber local variables along with general thread information.
|
65
|
+
# Airbrake.add_filter(Airbrake::Filters::ThreadFilter.new)
|
72
66
|
|
73
|
-
# Attaches loaded dependencies to the notice object
|
74
|
-
# (under context/versions/dependencies).
|
75
|
-
# Airbrake.add_filter(Airbrake::Filters::DependencyFilter.new)
|
67
|
+
# Attaches loaded dependencies to the notice object
|
68
|
+
# (under context/versions/dependencies).
|
69
|
+
# Airbrake.add_filter(Airbrake::Filters::DependencyFilter.new)
|
76
70
|
|
77
|
-
# If you want to convert your log messages to Airbrake errors, we offer an
|
78
|
-
# integration with the Logger class from stdlib.
|
79
|
-
# https://github.com/airbrake/airbrake#logger
|
80
|
-
# Rails.logger = Airbrake::AirbrakeLogger.new(Rails.logger)
|
71
|
+
# If you want to convert your log messages to Airbrake errors, we offer an
|
72
|
+
# integration with the Logger class from stdlib.
|
73
|
+
# https://github.com/airbrake/airbrake#logger
|
74
|
+
# Rails.logger = Airbrake::AirbrakeLogger.new(Rails.logger)
|
75
|
+
else
|
76
|
+
Rails.logger.warn(
|
77
|
+
"#{__FILE__}: Airbrake project id or project key is not set. " \
|
78
|
+
"Skipping Airbrake configuration"
|
79
|
+
)
|
80
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: airbrake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 12.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Airbrake Technologies, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: airbrake-ruby
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '6.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '6.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '13'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '13'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: pry
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -137,61 +137,47 @@ dependencies:
|
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
140
|
+
name: rack-test
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: '
|
145
|
+
version: '1.1'
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: '
|
153
|
-
- !ruby/object:Gem::Dependency
|
154
|
-
name: rack-test
|
155
|
-
requirement: !ruby/object:Gem::Requirement
|
156
|
-
requirements:
|
157
|
-
- - '='
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
version: 0.6.3
|
160
|
-
type: :development
|
161
|
-
prerelease: false
|
162
|
-
version_requirements: !ruby/object:Gem::Requirement
|
163
|
-
requirements:
|
164
|
-
- - '='
|
165
|
-
- !ruby/object:Gem::Version
|
166
|
-
version: 0.6.3
|
152
|
+
version: '1.1'
|
167
153
|
- !ruby/object:Gem::Dependency
|
168
154
|
name: redis
|
169
155
|
requirement: !ruby/object:Gem::Requirement
|
170
156
|
requirements:
|
171
157
|
- - '='
|
172
158
|
- !ruby/object:Gem::Version
|
173
|
-
version:
|
159
|
+
version: 4.1.4
|
174
160
|
type: :development
|
175
161
|
prerelease: false
|
176
162
|
version_requirements: !ruby/object:Gem::Requirement
|
177
163
|
requirements:
|
178
164
|
- - '='
|
179
165
|
- !ruby/object:Gem::Version
|
180
|
-
version:
|
166
|
+
version: 4.1.4
|
181
167
|
- !ruby/object:Gem::Dependency
|
182
168
|
name: sidekiq
|
183
169
|
requirement: !ruby/object:Gem::Requirement
|
184
170
|
requirements:
|
185
171
|
- - "~>"
|
186
172
|
- !ruby/object:Gem::Version
|
187
|
-
version: '
|
173
|
+
version: '6'
|
188
174
|
type: :development
|
189
175
|
prerelease: false
|
190
176
|
version_requirements: !ruby/object:Gem::Requirement
|
191
177
|
requirements:
|
192
178
|
- - "~>"
|
193
179
|
- !ruby/object:Gem::Version
|
194
|
-
version: '
|
180
|
+
version: '6'
|
195
181
|
- !ruby/object:Gem::Dependency
|
196
182
|
name: curb
|
197
183
|
requirement: !ruby/object:Gem::Requirement
|
@@ -226,14 +212,14 @@ dependencies:
|
|
226
212
|
requirements:
|
227
213
|
- - "~>"
|
228
214
|
- !ruby/object:Gem::Version
|
229
|
-
version: '
|
215
|
+
version: '5.0'
|
230
216
|
type: :development
|
231
217
|
prerelease: false
|
232
218
|
version_requirements: !ruby/object:Gem::Requirement
|
233
219
|
requirements:
|
234
220
|
- - "~>"
|
235
221
|
- !ruby/object:Gem::Version
|
236
|
-
version: '
|
222
|
+
version: '5.0'
|
237
223
|
- !ruby/object:Gem::Dependency
|
238
224
|
name: httpclient
|
239
225
|
requirement: !ruby/object:Gem::Requirement
|
@@ -268,34 +254,34 @@ dependencies:
|
|
268
254
|
requirements:
|
269
255
|
- - "~>"
|
270
256
|
- !ruby/object:Gem::Version
|
271
|
-
version: '
|
257
|
+
version: '4.0'
|
272
258
|
- - "<"
|
273
259
|
- !ruby/object:Gem::Version
|
274
|
-
version: '
|
260
|
+
version: '5.0'
|
275
261
|
type: :development
|
276
262
|
prerelease: false
|
277
263
|
version_requirements: !ruby/object:Gem::Requirement
|
278
264
|
requirements:
|
279
265
|
- - "~>"
|
280
266
|
- !ruby/object:Gem::Version
|
281
|
-
version: '
|
267
|
+
version: '4.0'
|
282
268
|
- - "<"
|
283
269
|
- !ruby/object:Gem::Version
|
284
|
-
version: '
|
270
|
+
version: '5.0'
|
285
271
|
- !ruby/object:Gem::Dependency
|
286
272
|
name: redis-namespace
|
287
273
|
requirement: !ruby/object:Gem::Requirement
|
288
274
|
requirements:
|
289
|
-
- -
|
275
|
+
- - "~>"
|
290
276
|
- !ruby/object:Gem::Version
|
291
|
-
version: 1.
|
277
|
+
version: '1.8'
|
292
278
|
type: :development
|
293
279
|
prerelease: false
|
294
280
|
version_requirements: !ruby/object:Gem::Requirement
|
295
281
|
requirements:
|
296
|
-
- -
|
282
|
+
- - "~>"
|
297
283
|
- !ruby/object:Gem::Version
|
298
|
-
version: 1.
|
284
|
+
version: '1.8'
|
299
285
|
description: |
|
300
286
|
Airbrake is an online tool that provides robust exception tracking in any of
|
301
287
|
your Ruby applications. In doing so, it allows you to easily review errors, tie
|
@@ -372,14 +358,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
372
358
|
requirements:
|
373
359
|
- - ">="
|
374
360
|
- !ruby/object:Gem::Version
|
375
|
-
version: '2.
|
361
|
+
version: '2.5'
|
376
362
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
377
363
|
requirements:
|
378
364
|
- - ">="
|
379
365
|
- !ruby/object:Gem::Version
|
380
366
|
version: '0'
|
381
367
|
requirements: []
|
382
|
-
rubygems_version: 3.1.
|
368
|
+
rubygems_version: 3.1.4
|
383
369
|
signing_key:
|
384
370
|
specification_version: 4
|
385
371
|
summary: Airbrake is an online tool that provides robust exception tracking in any
|