sentry-sidekiq 4.7.1 → 4.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +4 -2
- data/LICENSE.txt +1 -1
- data/Makefile +1 -1
- data/example/Gemfile +1 -0
- data/lib/sentry/sidekiq/sentry_context_middleware.rb +15 -2
- data/lib/sentry/sidekiq/version.rb +1 -1
- data/sentry-sidekiq.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: 949887e093455257abbf40b7ff7d8adbb3b28a149bc99a9668be4998089fca0c
|
4
|
+
data.tar.gz: c98f7768b82b010bfe34dc78b2920503e2599c1183efea781773d2be44dfa9af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fcfcf7c10ff0ca683834944b711bcf4a57492209b32aca63505db44be6fabcd9ed3e9c1671b8fc3c993a385671c5d88d732b7498140b022d45b9e0466e487780
|
7
|
+
data.tar.gz: 3c6594dba69cfb982254f40442ff6817a57e35c5359e7c330c6717a7855995d463b82f11ab191346575f6054e6b65fce69f12d2a1bcbb5ae3962f448aa939c09
|
data/Gemfile
CHANGED
@@ -5,7 +5,9 @@ gemspec
|
|
5
5
|
|
6
6
|
gem "rake", "~> 12.0"
|
7
7
|
gem "rspec", "~> 3.0"
|
8
|
-
gem
|
8
|
+
gem 'simplecov'
|
9
|
+
gem "simplecov-cobertura", "~> 1.4"
|
10
|
+
gem "rexml"
|
9
11
|
|
10
12
|
sidekiq_version = ENV["SIDEKIQ_VERSION"]
|
11
13
|
sidekiq_version = "6.0" if sidekiq_version.nil?
|
@@ -17,6 +19,6 @@ gem "sentry-ruby", path: "../sentry-ruby"
|
|
17
19
|
gem "sentry-rails", path: "../sentry-rails"
|
18
20
|
|
19
21
|
gem "object_tracer"
|
20
|
-
gem "debug", github: "ruby/debug" if RUBY_VERSION.to_f >= 2.6
|
22
|
+
gem "debug", github: "ruby/debug", platform: :ruby if RUBY_VERSION.to_f >= 2.6
|
21
23
|
gem "pry"
|
22
24
|
|
data/LICENSE.txt
CHANGED
data/Makefile
CHANGED
data/example/Gemfile
CHANGED
@@ -14,14 +14,15 @@ module Sentry
|
|
14
14
|
scope.set_user(user)
|
15
15
|
end
|
16
16
|
scope.set_tags(queue: queue, jid: job["jid"])
|
17
|
+
scope.set_tags(build_tags(job["tags"]))
|
17
18
|
scope.set_contexts(sidekiq: job.merge("queue" => queue))
|
18
19
|
scope.set_transaction_name(context_filter.transaction_name)
|
19
|
-
transaction =
|
20
|
+
transaction = start_transaction(scope.transaction_name, job["sentry_trace"])
|
20
21
|
scope.set_span(transaction) if transaction
|
21
22
|
|
22
23
|
begin
|
23
24
|
yield
|
24
|
-
rescue
|
25
|
+
rescue
|
25
26
|
finish_transaction(transaction, 500)
|
26
27
|
raise
|
27
28
|
end
|
@@ -32,6 +33,16 @@ module Sentry
|
|
32
33
|
scope.clear
|
33
34
|
end
|
34
35
|
|
36
|
+
def build_tags(tags)
|
37
|
+
Array(tags).each_with_object({}) { |name, tags_hash| tags_hash[:"sidekiq.#{name}"] = true }
|
38
|
+
end
|
39
|
+
|
40
|
+
def start_transaction(transaction_name, sentry_trace)
|
41
|
+
options = { name: transaction_name, op: "sidekiq" }
|
42
|
+
transaction = Sentry::Transaction.from_sentry_trace(sentry_trace, **options) if sentry_trace
|
43
|
+
Sentry.start_transaction(transaction: transaction, **options)
|
44
|
+
end
|
45
|
+
|
35
46
|
def finish_transaction(transaction, status)
|
36
47
|
return unless transaction
|
37
48
|
|
@@ -45,7 +56,9 @@ module Sentry
|
|
45
56
|
return yield unless Sentry.initialized?
|
46
57
|
|
47
58
|
user = Sentry.get_current_scope.user
|
59
|
+
transaction = Sentry.get_current_scope.get_transaction
|
48
60
|
job["sentry_user"] = user unless user.empty?
|
61
|
+
job["sentry_trace"] = transaction.to_sentry_trace if transaction
|
49
62
|
yield
|
50
63
|
end
|
51
64
|
end
|
data/sentry-sidekiq.gemspec
CHANGED
@@ -22,6 +22,6 @@ Gem::Specification.new do |spec|
|
|
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.8.1"
|
26
26
|
spec.add_dependency "sidekiq", ">= 3.0"
|
27
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sentry-sidekiq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.8.1
|
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-11-22 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.8.1
|
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.8.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: sidekiq
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|