airbrake 11.0.1 → 13.0.0
Sign up to get free protection for your applications and to get access to all the features.
- 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/app.rb +5 -5
- data/lib/airbrake/rails/http.rb +12 -8
- data/lib/airbrake/rails.rb +1 -1
- 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 +31 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a07739c02f3e1221ca95e82f58fd79a36a94419144079db6eec8a935b5f8bfad
|
4
|
+
data.tar.gz: 9e4da0976faf90b479903503fb00aa6f21b7bb469089c1795d6019ed5b001d4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4954a38023b2bd13afeef26690701876ab90141e7f552a020ce32f6182a5352d1211bba9d7f9965ebafc0603f444c1caeb1d282ef15e291ccec10298a5504e84
|
7
|
+
data.tar.gz: 9bcb90f9b3d621c2be1d3a653be9a434831f42399035af8eb57c8eac94c6f4c00d40d3bc2b8335794460b122277e0a9cee18cd44a57757ee492146188fc89054
|
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/app.rb
CHANGED
@@ -40,12 +40,12 @@ module Airbrake
|
|
40
40
|
# Skip "catch-all" routes such as:
|
41
41
|
# get '*path => 'pages#about'
|
42
42
|
#
|
43
|
-
#
|
44
|
-
#
|
45
|
-
#
|
43
|
+
# Ideally, we should be using `route.glob?` but in Rails 7+ this
|
44
|
+
# call would fail with a `NoMethodError`. This is because in
|
45
|
+
# Rails 7+ the AST for the route is not kept in memory anymore.
|
46
46
|
#
|
47
|
-
# https://github.com/rails/rails/
|
48
|
-
next if route.
|
47
|
+
# See: https://github.com/rails/rails/pull/43006#discussion_r783895766
|
48
|
+
next if route.path.spec.any?(ActionDispatch::Journey::Nodes::Star)
|
49
49
|
|
50
50
|
path =
|
51
51
|
if engine == ::Rails.application
|
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
@@ -11,7 +11,7 @@ module Airbrake
|
|
11
11
|
level = (::Rails.logger ? ::Rails.logger.level : Logger::ERROR)
|
12
12
|
|
13
13
|
if ENV['RAILS_LOG_TO_STDOUT'].present?
|
14
|
-
Logger.new(
|
14
|
+
Logger.new($stdout, level: level)
|
15
15
|
else
|
16
16
|
Logger.new(::Rails.root.join('log', 'airbrake.log'), level: level)
|
17
17
|
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: 13.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: 2022-01-18 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,75 +137,61 @@ 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.5'
|
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.5'
|
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
|
198
184
|
requirements:
|
199
185
|
- - "~>"
|
200
186
|
- !ruby/object:Gem::Version
|
201
|
-
version: '0
|
187
|
+
version: '1.0'
|
202
188
|
type: :development
|
203
189
|
prerelease: false
|
204
190
|
version_requirements: !ruby/object:Gem::Requirement
|
205
191
|
requirements:
|
206
192
|
- - "~>"
|
207
193
|
- !ruby/object:Gem::Version
|
208
|
-
version: '0
|
194
|
+
version: '1.0'
|
209
195
|
- !ruby/object:Gem::Dependency
|
210
196
|
name: excon
|
211
197
|
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
|
@@ -363,7 +349,8 @@ files:
|
|
363
349
|
homepage: https://airbrake.io
|
364
350
|
licenses:
|
365
351
|
- MIT
|
366
|
-
metadata:
|
352
|
+
metadata:
|
353
|
+
rubygems_mfa_required: 'true'
|
367
354
|
post_install_message:
|
368
355
|
rdoc_options: []
|
369
356
|
require_paths:
|
@@ -372,14 +359,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
372
359
|
requirements:
|
373
360
|
- - ">="
|
374
361
|
- !ruby/object:Gem::Version
|
375
|
-
version: '2.
|
362
|
+
version: '2.6'
|
376
363
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
377
364
|
requirements:
|
378
365
|
- - ">="
|
379
366
|
- !ruby/object:Gem::Version
|
380
367
|
version: '0'
|
381
368
|
requirements: []
|
382
|
-
rubygems_version: 3.
|
369
|
+
rubygems_version: 3.2.32
|
383
370
|
signing_key:
|
384
371
|
specification_version: 4
|
385
372
|
summary: Airbrake is an online tool that provides robust exception tracking in any
|