airbrake 10.0.0 → 10.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/airbrake.rb +2 -0
- data/lib/airbrake/capistrano.rb +2 -0
- data/lib/airbrake/capistrano/capistrano2.rb +2 -0
- data/lib/airbrake/capistrano/capistrano3.rb +2 -0
- data/lib/airbrake/delayed_job.rb +2 -0
- data/lib/airbrake/logger.rb +2 -0
- data/lib/airbrake/rack.rb +2 -0
- data/lib/airbrake/rack/context_filter.rb +2 -0
- data/lib/airbrake/rack/http_headers_filter.rb +2 -0
- data/lib/airbrake/rack/http_params_filter.rb +2 -0
- data/lib/airbrake/rack/instrumentable.rb +112 -4
- data/lib/airbrake/rack/middleware.rb +2 -0
- data/lib/airbrake/rack/request_body_filter.rb +2 -0
- data/lib/airbrake/rack/request_store.rb +2 -0
- data/lib/airbrake/rack/route_filter.rb +2 -0
- data/lib/airbrake/rack/session_filter.rb +2 -0
- data/lib/airbrake/rack/user.rb +2 -0
- data/lib/airbrake/rack/user_filter.rb +2 -0
- data/lib/airbrake/rails.rb +2 -0
- data/lib/airbrake/rails/action_cable.rb +2 -0
- data/lib/airbrake/rails/action_cable/notify_callback.rb +2 -0
- data/lib/airbrake/rails/action_controller.rb +2 -0
- data/lib/airbrake/rails/action_controller_notify_subscriber.rb +2 -0
- data/lib/airbrake/rails/action_controller_performance_breakdown_subscriber.rb +2 -0
- data/lib/airbrake/rails/action_controller_route_subscriber.rb +2 -0
- data/lib/airbrake/rails/active_job.rb +2 -0
- data/lib/airbrake/rails/active_record.rb +2 -0
- data/lib/airbrake/rails/active_record_subscriber.rb +2 -0
- data/lib/airbrake/rails/app.rb +2 -0
- data/lib/airbrake/rails/backtrace_cleaner.rb +2 -0
- data/lib/airbrake/rails/curb.rb +2 -0
- data/lib/airbrake/rails/event.rb +2 -0
- data/lib/airbrake/rails/excon_subscriber.rb +2 -0
- data/lib/airbrake/rails/http.rb +2 -0
- data/lib/airbrake/rails/http_client.rb +2 -0
- data/lib/airbrake/rails/net_http.rb +2 -0
- data/lib/airbrake/rails/railtie.rb +3 -1
- data/lib/airbrake/rails/typhoeus.rb +2 -0
- data/lib/airbrake/rake.rb +2 -0
- data/lib/airbrake/rake/tasks.rb +5 -3
- data/lib/airbrake/resque.rb +2 -0
- data/lib/airbrake/shoryuken.rb +2 -0
- data/lib/airbrake/sidekiq.rb +2 -0
- data/lib/airbrake/sidekiq/retryable_jobs_filter.rb +2 -0
- data/lib/airbrake/sneakers.rb +6 -1
- data/lib/airbrake/version.rb +3 -1
- data/lib/generators/airbrake_generator.rb +2 -0
- data/lib/generators/airbrake_initializer.rb.erb +2 -0
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6ebb0d64b92742b80afe65583bf19f6c3fc7352d146e95765b8c5b7d2d1949b
|
4
|
+
data.tar.gz: 2e02317eeb64c7f4ece9173b88af2033c13d630dc9072232d39a697495da3f19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b69a9609edd060362d33626f715696ce41a49f05a796ad314f7cb7258d3e7b03274ebeb7ef8c4c17fc004f64cdd56f3af51ba5c59f62acaeb2416ee7517d3af2
|
7
|
+
data.tar.gz: 99b1645d2b95c0d73d2bad8a2bc04960334e14e8d0d13f613d30f7666f250b05d5e0567944113302e8c6a6dc40a17fc8e897d6fc578af41af96426f07b79efc3
|
data/lib/airbrake.rb
CHANGED
data/lib/airbrake/capistrano.rb
CHANGED
data/lib/airbrake/delayed_job.rb
CHANGED
data/lib/airbrake/logger.rb
CHANGED
data/lib/airbrake/rack.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Airbrake
|
2
4
|
module Rack
|
3
5
|
# Instrumentable holds methods that simplify instrumenting Rack apps.
|
@@ -15,14 +17,120 @@ module Airbrake
|
|
15
17
|
# @since v9.2.0
|
16
18
|
module Instrumentable
|
17
19
|
def airbrake_capture_timing(method_name, label: method_name.to_s)
|
18
|
-
|
20
|
+
instrumentable = ::Airbrake::Rack::Instrumentable
|
21
|
+
if instrumentable.should_prepend?(self, method_name)
|
22
|
+
instrumentable.prepend_capture_timing(self, method_name, label)
|
23
|
+
else
|
24
|
+
instrumentable.chain_capture_timing(self, method_name, label)
|
25
|
+
end
|
26
|
+
method_name
|
27
|
+
end
|
28
|
+
|
29
|
+
# @api private
|
30
|
+
def __airbrake_capture_timing_module__
|
31
|
+
# Module used to store prepended wrapper methods, saved as an instance
|
32
|
+
# variable so each target class/module gets its own module. This just
|
33
|
+
# a convenience to avoid prepending a lot of anonymous modules.
|
34
|
+
@__airbrake_capture_timing_module__ ||= ::Module.new
|
35
|
+
end
|
36
|
+
private :__airbrake_capture_timing_module__
|
37
|
+
|
38
|
+
# Using api private self methods so they don't get defined in the target
|
39
|
+
# class or module, but can still be called by the above method.
|
40
|
+
|
41
|
+
# @api private
|
42
|
+
def self.should_prepend?(klass, method_name)
|
43
|
+
# Don't chain already-prepended or operator methods.
|
44
|
+
klass.module_exec do
|
45
|
+
self_class_idx = ancestors.index(self)
|
46
|
+
method_owner_idx = ancestors.index(instance_method(method_name).owner)
|
47
|
+
method_owner_idx < self_class_idx || !(/\A\W/ =~ method_name).nil?
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
# @api private
|
52
|
+
def self.prepend_capture_timing(klass, method_name, label)
|
53
|
+
args = method_signature
|
54
|
+
visibility = method_visibility(klass, method_name)
|
55
|
+
|
56
|
+
# Generate the wrapper method.
|
57
|
+
klass.module_exec do
|
58
|
+
mod = __airbrake_capture_timing_module__
|
59
|
+
mod.module_exec do
|
60
|
+
module_eval <<-RUBY, __FILE__, __LINE__ + 1
|
61
|
+
def #{method_name}(#{args})
|
62
|
+
Airbrake::Rack.capture_timing(#{label.to_s.inspect}) do
|
63
|
+
super
|
64
|
+
end
|
65
|
+
end
|
66
|
+
#{visibility} :#{method_name}
|
67
|
+
RUBY
|
68
|
+
end
|
69
|
+
prepend mod
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
# @api private
|
74
|
+
def self.chain_capture_timing(klass, method_name, label)
|
75
|
+
args = method_signature
|
76
|
+
visibility = method_visibility(klass, method_name)
|
19
77
|
|
20
|
-
|
21
|
-
|
22
|
-
|
78
|
+
# Generate the wrapper method.
|
79
|
+
aliased = method_name.to_s.sub(/([?!=])$/, '')
|
80
|
+
punctuation = Regexp.last_match(1)
|
81
|
+
wrapped_method_name = "#{aliased}_without_airbrake#{punctuation}"
|
82
|
+
needs_removal = method_needs_removal(klass, method_name)
|
83
|
+
klass.module_exec do
|
84
|
+
alias_method wrapped_method_name, method_name
|
85
|
+
remove_method method_name if needs_removal
|
86
|
+
module_eval <<-RUBY, __FILE__, __LINE__ + 1
|
87
|
+
def #{method_name}(#{args})
|
88
|
+
Airbrake::Rack.capture_timing(#{label.to_s.inspect}) do
|
89
|
+
__send__("#{aliased}_without_airbrake#{punctuation}", #{args})
|
90
|
+
end
|
91
|
+
end
|
92
|
+
#{visibility} :#{method_name}
|
93
|
+
RUBY
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
# @api private
|
98
|
+
def self.method_visibility(klass, method_name)
|
99
|
+
klass.module_exec do
|
100
|
+
if protected_method_defined?(method_name)
|
101
|
+
"protected".freeze
|
102
|
+
elsif private_method_defined?(method_name)
|
103
|
+
"private".freeze
|
104
|
+
else
|
105
|
+
"public".freeze
|
23
106
|
end
|
24
107
|
end
|
25
108
|
end
|
109
|
+
|
110
|
+
# @api private
|
111
|
+
# A method instead of a constant so it isn't accessible in the target.
|
112
|
+
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.7")
|
113
|
+
def self.method_signature
|
114
|
+
"*args, **kw_args, &block".freeze
|
115
|
+
end
|
116
|
+
else
|
117
|
+
def self.method_signature
|
118
|
+
"*args, &block".freeze
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
# @api private
|
123
|
+
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.6")
|
124
|
+
def self.method_needs_removal(klass, method_name)
|
125
|
+
klass.method_defined?(method_name, false) ||
|
126
|
+
klass.private_method_defined?(method_name, false)
|
127
|
+
end
|
128
|
+
else
|
129
|
+
def self.method_needs_removal(klass, method_name)
|
130
|
+
klass.instance_methods(false).include?(method_name) ||
|
131
|
+
klass.private_instance_methods(false).include?(method_name)
|
132
|
+
end
|
133
|
+
end
|
26
134
|
end
|
27
135
|
end
|
28
136
|
end
|
data/lib/airbrake/rack/user.rb
CHANGED
data/lib/airbrake/rails.rb
CHANGED
data/lib/airbrake/rails/app.rb
CHANGED
data/lib/airbrake/rails/curb.rb
CHANGED
data/lib/airbrake/rails/event.rb
CHANGED
data/lib/airbrake/rails/http.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Airbrake
|
2
4
|
module Rails
|
3
5
|
# This railtie works for any Rails application that supports railties (Rails
|
4
6
|
# 3.2+ apps). It makes Airbrake Ruby work with Rails and report errors
|
5
7
|
# occurring in the application automatically.
|
6
8
|
class Railtie < ::Rails::Railtie
|
7
|
-
initializer('airbrake.middleware') do |app|
|
9
|
+
initializer('airbrake.middleware', after: :load_config_initializers) do |app|
|
8
10
|
# Since Rails 3.2 the ActionDispatch::DebugExceptions middleware is
|
9
11
|
# responsible for logging exceptions and showing a debugging page in
|
10
12
|
# case the request is local. We want to insert our middleware after
|
data/lib/airbrake/rake.rb
CHANGED
data/lib/airbrake/rake/tasks.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'airbrake-ruby'
|
2
4
|
|
3
5
|
namespace :airbrake do
|
@@ -97,14 +99,14 @@ namespace :airbrake do
|
|
97
99
|
end
|
98
100
|
end
|
99
101
|
|
100
|
-
url = "https://airbrake.io/api/v3/projects/#{id}/heroku-deploys?key=#{key}"
|
102
|
+
url = ["https://airbrake.io/api/v3/projects/#{id}/heroku-deploys?key=#{key}"]
|
101
103
|
url << "&environment=#{env}"
|
102
104
|
url << "&repository=#{repo}" unless repo.empty?
|
103
105
|
|
104
|
-
command = %(heroku addons:create deployhooks:http --url="#{url}")
|
106
|
+
command = [%(heroku addons:create deployhooks:http --url="#{url.join}")]
|
105
107
|
command << " --app #{app}" if app
|
106
108
|
|
107
|
-
puts "$ #{command}"
|
109
|
+
puts "$ #{command.join}"
|
108
110
|
Bundler.with_clean_env { puts `#{command}` }
|
109
111
|
end
|
110
112
|
end
|
data/lib/airbrake/resque.rb
CHANGED
data/lib/airbrake/shoryuken.rb
CHANGED
data/lib/airbrake/sidekiq.rb
CHANGED
data/lib/airbrake/sneakers.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Airbrake
|
2
4
|
module Sneakers
|
3
5
|
# Provides integration with Sneakers.
|
@@ -10,12 +12,15 @@ module Airbrake
|
|
10
12
|
# @see https://github.com/airbrake/airbrake/issues/850
|
11
13
|
IGNORED_KEYS = %i[delivery_tag consumer channel].freeze
|
12
14
|
|
13
|
-
|
15
|
+
# rubocop:disable Style/OptionalArguments
|
16
|
+
def call(exception, worker = nil, context)
|
17
|
+
# Later versions add a middle argument.
|
14
18
|
Airbrake.notify(exception, filter_context(context)) do |notice|
|
15
19
|
notice[:context][:component] = 'sneakers'
|
16
20
|
notice[:context][:action] = worker.class.to_s
|
17
21
|
end
|
18
22
|
end
|
23
|
+
# rubocop:enable Style/OptionalArguments
|
19
24
|
|
20
25
|
private
|
21
26
|
|
data/lib/airbrake/version.rb
CHANGED
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: 10.0.
|
4
|
+
version: 10.0.1
|
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: 2020-01-
|
11
|
+
date: 2020-01-29 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: '4.
|
19
|
+
version: '4.13'
|
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: '4.
|
26
|
+
version: '4.13'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -435,8 +435,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
435
435
|
- !ruby/object:Gem::Version
|
436
436
|
version: '0'
|
437
437
|
requirements: []
|
438
|
-
|
439
|
-
rubygems_version: 2.7.6.2
|
438
|
+
rubygems_version: 3.1.2
|
440
439
|
signing_key:
|
441
440
|
specification_version: 4
|
442
441
|
summary: Airbrake is an online tool that provides robust exception tracking in any
|