sentry-rails 4.8.1 → 4.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/jobs/sentry/send_event_job.rb +2 -2
- data/lib/sentry/rails/active_job.rb +25 -37
- data/lib/sentry/rails/version.rb +1 -1
- data/sentry-rails.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64f471f2aff155e81f92c86c0dd054200366be64a8d3490fd55b4a25dc3143cb
|
4
|
+
data.tar.gz: 2a9504b5dbb3960d4a8115422bcaa837f1c8c725e53315daeab4a279e306c781
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f30474068722a83f53855b9f637ea85834e2d075a625216ea8405c45d919ff43af25322ad7d6b4c104c2a845ad5da183923dffad5e6413d4f443e9ef89ebf30
|
7
|
+
data.tar.gz: '09002189531ad1ad22757d3b20cda8a9df782eb7a9bdf07499a3f9d6d9e6a17d1d57120e7519f6f9408e1836c99b369919cfb01c1c23e614ebf76fdc37425ee6'
|
@@ -16,8 +16,8 @@ if defined?(ActiveJob)
|
|
16
16
|
discard_on ActiveJob::DeserializationError
|
17
17
|
else
|
18
18
|
# mimic what discard_on does for Rails 5.0
|
19
|
-
rescue_from ActiveJob::DeserializationError do
|
20
|
-
logger.error "Discarded #{self.class} due to a #{exception}. The original exception was #{
|
19
|
+
rescue_from ActiveJob::DeserializationError do |exception|
|
20
|
+
logger.error "Discarded #{self.class} due to a #{exception}. The original exception was #{exception.cause.inspect}."
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
@@ -1,28 +1,22 @@
|
|
1
1
|
module Sentry
|
2
2
|
module Rails
|
3
3
|
module ActiveJobExtensions
|
4
|
-
def
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
Sentry.with_scope do |scope|
|
12
|
-
capture_and_reraise_with_sentry(job, scope, block)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
else
|
16
|
-
block.call
|
4
|
+
def perform_now
|
5
|
+
if !Sentry.initialized? || already_supported_by_sentry_integration?
|
6
|
+
super
|
7
|
+
else
|
8
|
+
Sentry.with_scope do |scope|
|
9
|
+
capture_and_reraise_with_sentry(scope) do
|
10
|
+
super
|
17
11
|
end
|
18
12
|
end
|
19
13
|
end
|
20
14
|
end
|
21
15
|
|
22
|
-
def capture_and_reraise_with_sentry(
|
23
|
-
scope.set_transaction_name(
|
16
|
+
def capture_and_reraise_with_sentry(scope, &block)
|
17
|
+
scope.set_transaction_name(self.class.name)
|
24
18
|
transaction =
|
25
|
-
if
|
19
|
+
if is_a?(::Sentry::SendEventJob)
|
26
20
|
nil
|
27
21
|
else
|
28
22
|
Sentry.start_transaction(name: scope.transaction_name, op: "active_job")
|
@@ -32,48 +26,42 @@ module Sentry
|
|
32
26
|
|
33
27
|
block.call
|
34
28
|
|
35
|
-
|
29
|
+
finish_sentry_transaction(transaction, 200)
|
36
30
|
rescue Exception => e # rubocop:disable Lint/RescueException
|
37
|
-
|
38
|
-
finish_transaction(transaction, 500)
|
39
|
-
return rescue_handler_result if rescue_handler_result
|
31
|
+
finish_sentry_transaction(transaction, 500)
|
40
32
|
|
41
33
|
Sentry::Rails.capture_exception(
|
42
34
|
e,
|
43
|
-
extra: sentry_context
|
35
|
+
extra: sentry_context,
|
44
36
|
tags: {
|
45
|
-
job_id:
|
46
|
-
provider_job_id:
|
37
|
+
job_id: job_id,
|
38
|
+
provider_job_id:provider_job_id
|
47
39
|
}
|
48
40
|
)
|
49
41
|
raise e
|
50
42
|
end
|
51
43
|
|
52
|
-
def
|
44
|
+
def finish_sentry_transaction(transaction, status)
|
53
45
|
return unless transaction
|
54
46
|
|
55
47
|
transaction.set_http_status(status)
|
56
48
|
transaction.finish
|
57
49
|
end
|
58
50
|
|
59
|
-
def
|
60
|
-
Sentry.configuration.rails.skippable_job_adapters.include?(
|
51
|
+
def already_supported_by_sentry_integration?
|
52
|
+
Sentry.configuration.rails.skippable_job_adapters.include?(self.class.queue_adapter.class.to_s)
|
61
53
|
end
|
62
54
|
|
63
|
-
def sentry_context
|
55
|
+
def sentry_context
|
64
56
|
{
|
65
|
-
active_job:
|
66
|
-
arguments:
|
67
|
-
scheduled_at:
|
68
|
-
job_id:
|
69
|
-
provider_job_id:
|
70
|
-
locale:
|
57
|
+
active_job: self.class.name,
|
58
|
+
arguments: arguments,
|
59
|
+
scheduled_at: scheduled_at,
|
60
|
+
job_id: job_id,
|
61
|
+
provider_job_id: provider_job_id,
|
62
|
+
locale: locale
|
71
63
|
}
|
72
64
|
end
|
73
65
|
end
|
74
66
|
end
|
75
67
|
end
|
76
|
-
|
77
|
-
class ActiveJob::Base
|
78
|
-
include Sentry::Rails::ActiveJobExtensions
|
79
|
-
end
|
data/lib/sentry/rails/version.rb
CHANGED
data/sentry-rails.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sentry-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.8.
|
4
|
+
version: 4.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sentry Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 4.8.
|
33
|
+
version: 4.8.2
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 4.8.
|
40
|
+
version: 4.8.2
|
41
41
|
description: A gem that provides Rails integration for the Sentry error logger
|
42
42
|
email: accounts@sentry.io
|
43
43
|
executables: []
|