sentry-delayed_job 4.4.0 → 4.6.0.pre.beta.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -0
- data/lib/sentry/delayed_job/plugin.rb +27 -3
- data/lib/sentry/delayed_job/version.rb +1 -1
- data/sentry-delayed_job.gemspec +2 -2
- metadata +8 -9
- data/.craft.yml +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff77412f69232d9b4a44a50ad61be219fd7243edd1673793b680d89ee0fb7ce8
|
4
|
+
data.tar.gz: c7c3b1c09d8ac2012fc5b4820c0477c2a128bd684f352309be40173d92e24f01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6da1edb4eb50843bdf4bb0fd8ec03e7931ad35dc16e4f6a6657ec163d12b04da71593072fe2b59a76cc60ff61ff221faba1bdeae60ee380bc21214ebaedd5802
|
7
|
+
data.tar.gz: e6c813ec3294a09af41ad913a78b71ae87bca123fea9798a854c595ff70f21107350c154d5a58042bbe12d2928c9983935492d3cf7208680d251f4624ef43689
|
data/CHANGELOG.md
CHANGED
@@ -13,14 +13,21 @@ module Sentry
|
|
13
13
|
next block.call(job, *args) unless Sentry.initialized?
|
14
14
|
|
15
15
|
Sentry.with_scope do |scope|
|
16
|
-
|
16
|
+
contexts = generate_contexts(job)
|
17
|
+
scope.set_transaction_name(contexts.dig(ACTIVE_JOB_CONTEXT_KEY, :job_class) || contexts.dig(DELAYED_JOB_CONTEXT_KEY, :job_class))
|
18
|
+
scope.set_contexts(**contexts)
|
17
19
|
scope.set_tags("delayed_job.queue" => job.queue, "delayed_job.id" => job.id.to_s)
|
18
20
|
|
21
|
+
transaction = Sentry.start_transaction(name: scope.transaction_name, op: "delayed_job")
|
22
|
+
scope.set_span(transaction) if transaction
|
23
|
+
|
19
24
|
begin
|
20
25
|
block.call(job, *args)
|
26
|
+
|
27
|
+
finish_transaction(transaction, 200)
|
21
28
|
rescue Exception => e
|
22
29
|
capture_exception(e, job)
|
23
|
-
|
30
|
+
finish_transaction(transaction, 500)
|
24
31
|
raise
|
25
32
|
end
|
26
33
|
end
|
@@ -40,7 +47,8 @@ module Sentry
|
|
40
47
|
queue: job.queue,
|
41
48
|
created_at: job.created_at,
|
42
49
|
last_error: job.last_error&.byteslice(0..1000),
|
43
|
-
handler: job.handler&.byteslice(0..1000)
|
50
|
+
handler: job.handler&.byteslice(0..1000),
|
51
|
+
job_class: compute_job_class(job.payload_object),
|
44
52
|
}
|
45
53
|
|
46
54
|
if job.payload_object.respond_to?(:job_data)
|
@@ -54,6 +62,15 @@ module Sentry
|
|
54
62
|
context
|
55
63
|
end
|
56
64
|
|
65
|
+
def self.compute_job_class(payload_object)
|
66
|
+
if payload_object.is_a? Delayed::PerformableMethod
|
67
|
+
klass = payload_object.object.is_a?(Class) ? payload_object.object.name : payload_object.object.class.name
|
68
|
+
"#{klass}##{payload_object.method_name}"
|
69
|
+
else
|
70
|
+
payload_object.class.name
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
57
74
|
def self.capture_exception(exception, job)
|
58
75
|
Sentry::DelayedJob.capture_exception(exception, hint: { background: false }) if report?(job)
|
59
76
|
end
|
@@ -65,6 +82,13 @@ module Sentry
|
|
65
82
|
# count at this point.
|
66
83
|
job.attempts >= Delayed::Worker.max_attempts.pred
|
67
84
|
end
|
85
|
+
|
86
|
+
def self.finish_transaction(transaction, status)
|
87
|
+
return unless transaction
|
88
|
+
|
89
|
+
transaction.set_http_status(status)
|
90
|
+
transaction.finish
|
91
|
+
end
|
68
92
|
end
|
69
93
|
end
|
70
94
|
end
|
data/sentry-delayed_job.gemspec
CHANGED
@@ -16,11 +16,11 @@ Gem::Specification.new do |spec|
|
|
16
16
|
|
17
17
|
spec.metadata["homepage_uri"] = spec.homepage
|
18
18
|
spec.metadata["source_code_uri"] = spec.homepage
|
19
|
-
spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/master/
|
19
|
+
spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/master/CHANGELOG.md"
|
20
20
|
|
21
21
|
spec.bindir = "exe"
|
22
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
23
|
spec.require_paths = ["lib"]
|
24
24
|
|
25
|
-
spec.add_dependency "sentry-ruby-core", "~> 4.
|
25
|
+
spec.add_dependency "sentry-ruby-core", "~> 4.6.0-beta.0"
|
26
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sentry-delayed_job
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.6.0.pre.beta.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sentry Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sentry-ruby-core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4.
|
19
|
+
version: 4.6.0.pre.beta.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: 4.
|
26
|
+
version: 4.6.0.pre.beta.0
|
27
27
|
description: A gem that provides DelayedJob integration for the Sentry error logger
|
28
28
|
email: accounts@sentry.io
|
29
29
|
executables: []
|
@@ -32,7 +32,6 @@ extra_rdoc_files:
|
|
32
32
|
- README.md
|
33
33
|
- LICENSE.txt
|
34
34
|
files:
|
35
|
-
- ".craft.yml"
|
36
35
|
- ".gitignore"
|
37
36
|
- ".rspec"
|
38
37
|
- CHANGELOG.md
|
@@ -57,7 +56,7 @@ licenses:
|
|
57
56
|
metadata:
|
58
57
|
homepage_uri: https://github.com/getsentry/sentry-ruby
|
59
58
|
source_code_uri: https://github.com/getsentry/sentry-ruby
|
60
|
-
changelog_uri: https://github.com/getsentry/sentry-ruby/blob/master/
|
59
|
+
changelog_uri: https://github.com/getsentry/sentry-ruby/blob/master/CHANGELOG.md
|
61
60
|
post_install_message:
|
62
61
|
rdoc_options: []
|
63
62
|
require_paths:
|
@@ -69,11 +68,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
69
68
|
version: '2.4'
|
70
69
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
71
70
|
requirements:
|
72
|
-
- - "
|
71
|
+
- - ">"
|
73
72
|
- !ruby/object:Gem::Version
|
74
|
-
version:
|
73
|
+
version: 1.3.1
|
75
74
|
requirements: []
|
76
|
-
rubygems_version: 3.
|
75
|
+
rubygems_version: 3.1.6
|
77
76
|
signing_key:
|
78
77
|
specification_version: 4
|
79
78
|
summary: A gem that provides DelayedJob integration for the Sentry error logger
|
data/.craft.yml
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
minVersion: '0.13.2'
|
2
|
-
github:
|
3
|
-
owner: getsentry
|
4
|
-
repo: sentry-ruby
|
5
|
-
changelogPolicy: simple
|
6
|
-
preReleaseCommand: ruby ../.scripts/bump-version.rb
|
7
|
-
releaseBranchPrefix: release-sentry-delayed_job
|
8
|
-
statusProvider:
|
9
|
-
name: github
|
10
|
-
artifactProvider:
|
11
|
-
name: github
|
12
|
-
targets:
|
13
|
-
- name: gem
|
14
|
-
- name: registry
|
15
|
-
type: sdk
|
16
|
-
config:
|
17
|
-
canonical: 'gem:sentry-delayed_job'
|
18
|
-
- name: github
|
19
|
-
tagPrefix: sentry-delayed_job-v
|
20
|
-
changelog: sentry-delayed_job/CHANGELOG
|