appsignal 4.0.0-java → 4.0.1-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/appsignal/hooks/at_exit.rb +10 -0
- data/lib/appsignal/integrations/railtie.rb +12 -0
- data/lib/appsignal/version.rb +1 -1
- data/spec/lib/appsignal/hooks/at_exit_spec.rb +12 -1
- data/spec/lib/appsignal/integrations/railtie_spec.rb +11 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18afa026e2be1701d2d94a5265da02f3b3562d62537e02e57627dc6b6f734801
|
4
|
+
data.tar.gz: a966ab77ff86d6620d1f66f09bec4858e35c796fc2998f5fa14ce72a595136b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f59a9676917f341cddf66afeb705140ee5b5a09c96029fc296efb61dd1c06513b2121b2ffcff0e21f1deeb4e7a25ce8647761822c95d27f03005293b39d2d29
|
7
|
+
data.tar.gz: cc80c914a1ca31432f72a136976ef409429baa79d0dc1480d213fa10bcfa627f8c0aabad267aedfdc1506285f0a4fc396424c4f741564fb3e4937898bdef3ccc
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# AppSignal for Ruby gem Changelog
|
2
2
|
|
3
|
+
## 4.0.1
|
4
|
+
|
5
|
+
_Published on 2024-08-23._
|
6
|
+
|
7
|
+
### Fixed
|
8
|
+
|
9
|
+
- Do not report `Sidekiq::JobRetry::Skip` errors. These errors would be reported by our Rails error subscriber. This is an internal Sidekiq error we do not need to report. (patch [9ea2d3e8](https://github.com/appsignal/appsignal-ruby/commit/9ea2d3e83657d115baf166257a50c7e3394318aa))
|
10
|
+
- Do not report `SystemExit` errors from our `at_exit` error reporter. (patch [e9c0cad3](https://github.com/appsignal/appsignal-ruby/commit/e9c0cad3d672e68a63ca9c33cfa30a3434c77d04))
|
11
|
+
|
3
12
|
## 4.0.0
|
4
13
|
|
5
14
|
_Published on 2024-08-23._
|
@@ -24,6 +24,7 @@ module Appsignal
|
|
24
24
|
class AtExitCallback
|
25
25
|
def self.call
|
26
26
|
error = $! # rubocop:disable Style/SpecialGlobalVars
|
27
|
+
return if ignored_error?(error)
|
27
28
|
return if Appsignal::Transaction.last_errors.include?(error)
|
28
29
|
|
29
30
|
Appsignal.report_error(error) do |transaction|
|
@@ -31,6 +32,15 @@ module Appsignal
|
|
31
32
|
end
|
32
33
|
Appsignal.stop("at_exit")
|
33
34
|
end
|
35
|
+
|
36
|
+
IGNORED_ERRORS = [
|
37
|
+
# Normal exits from the application we do not need to report
|
38
|
+
SystemExit
|
39
|
+
].freeze
|
40
|
+
|
41
|
+
def self.ignored_error?(error)
|
42
|
+
IGNORED_ERRORS.include?(error.class)
|
43
|
+
end
|
34
44
|
end
|
35
45
|
end
|
36
46
|
end
|
@@ -80,6 +80,8 @@ module Appsignal
|
|
80
80
|
class RailsErrorReporterSubscriber
|
81
81
|
class << self
|
82
82
|
def report(error, handled:, severity:, context: {}, source: nil) # rubocop:disable Lint/UnusedMethodArgument
|
83
|
+
return if ignored_error?(error)
|
84
|
+
|
83
85
|
is_rails_runner = source == "application.runner.railties"
|
84
86
|
namespace, action_name, tags, custom_data = context_for(context.dup)
|
85
87
|
|
@@ -100,6 +102,16 @@ module Appsignal
|
|
100
102
|
|
101
103
|
private
|
102
104
|
|
105
|
+
IGNORED_ERRORS = [
|
106
|
+
# We don't need to alert Sidekiq job skip errors.
|
107
|
+
# This is an internal Sidekiq error.
|
108
|
+
"Sidekiq::JobRetry::Skip"
|
109
|
+
].freeze
|
110
|
+
|
111
|
+
def ignored_error?(error)
|
112
|
+
IGNORED_ERRORS.include?(error.class.name)
|
113
|
+
end
|
114
|
+
|
103
115
|
def context_for(context)
|
104
116
|
tags = {}
|
105
117
|
|
data/lib/appsignal/version.rb
CHANGED
@@ -59,7 +59,7 @@ describe Appsignal::Hooks::AtExit::AtExitCallback do
|
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
|
-
it "doesn't report the error if is also the last error reported" do
|
62
|
+
it "doesn't report the error if it is also the last error reported" do
|
63
63
|
with_error(ExampleException, "error message") do |error|
|
64
64
|
Appsignal.report_error(error)
|
65
65
|
expect(created_transactions.count).to eq(1)
|
@@ -69,4 +69,15 @@ describe Appsignal::Hooks::AtExit::AtExitCallback do
|
|
69
69
|
end.to_not change { created_transactions.count }.from(1)
|
70
70
|
end
|
71
71
|
end
|
72
|
+
|
73
|
+
it "doesn't report the error if it is a SystemExit exception" do
|
74
|
+
with_error(SystemExit, "error message") do |error|
|
75
|
+
Appsignal.report_error(error)
|
76
|
+
expect(created_transactions.count).to eq(1)
|
77
|
+
|
78
|
+
expect do
|
79
|
+
call_callback
|
80
|
+
end.to_not change { created_transactions.count }.from(1)
|
81
|
+
end
|
82
|
+
end
|
72
83
|
end
|
@@ -229,6 +229,17 @@ if DependencyHelper.rails_present?
|
|
229
229
|
expect(last_transaction).to have_error("ExampleStandardError", "error message")
|
230
230
|
end
|
231
231
|
|
232
|
+
it "ignores Sidekiq::JobRetry::Skip errors" do
|
233
|
+
require "sidekiq"
|
234
|
+
require "sidekiq/job_retry"
|
235
|
+
|
236
|
+
with_rails_error_reporter do
|
237
|
+
Rails.error.handle { raise Sidekiq::JobRetry::Skip, "error message" }
|
238
|
+
end
|
239
|
+
|
240
|
+
expect(last_transaction).to_not have_error
|
241
|
+
end
|
242
|
+
|
232
243
|
context "when no transaction is active" do
|
233
244
|
it "reports the error on a new transaction" do
|
234
245
|
with_rails_error_reporter do
|