appsignal 4.0.0 → 4.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7a51d521ee51d28f13d297b5dd7e00291a701dda4e3e0a639779b5c52c9e0551
4
- data.tar.gz: ec09dc858c399b9004cebb9afcdb1e041ba4f0efd068f173c6177e2bb5d10b1c
3
+ metadata.gz: 388a88a0721342be7efbc7e0398bc42b96d1958805ca58785da79835305114b5
4
+ data.tar.gz: a966ab77ff86d6620d1f66f09bec4858e35c796fc2998f5fa14ce72a595136b6
5
5
  SHA512:
6
- metadata.gz: c8d87696bdeb0bf26784c001b67c9fb1201120ad325671b959cf807317dc3c2e948a62c8ce3e5618abc44ae2b5f30b66ee2414e72ee7eb1c55728a001717665e
7
- data.tar.gz: 6da6a43068a8edf31158269f956be507f2125ec61dd8374192f228582c730862a5a659d5b2f530e7c995264e571d2e27daf049367089608dcdbbb63b5db16ef9
6
+ metadata.gz: 0c0518fb68bde59898885efe4c0ab89c596aa9002565bb608ad836262392fe4c9700cfe39c117818a26ddf2e0982bcef050b84e09e91a7f3100d3bb659e6d9d4
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Appsignal
4
- VERSION = "4.0.0"
4
+ VERSION = "4.0.1"
5
5
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appsignal
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Beekman