sentry-sidekiq 4.5.2 → 4.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sentry-sidekiq.rb +6 -1
- data/lib/sentry/sidekiq/sentry_context_middleware.rb +14 -1
- data/lib/sentry/sidekiq/version.rb +1 -1
- data/sentry-sidekiq.gemspec +2 -1
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eccd0c1d7cffe7eecd455ab2dcb303e555e609358d9949c27c328533e0df3ece
|
4
|
+
data.tar.gz: 6d9d38f849f8350b343ba1e52afb69b144a2d8524467b926a3af325e11e7312d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a01bddf2c4072d21f136545d0d35b1b61c12c345208839ed71df7916782a95c77f96c98da72930149e58a2b688a5630e5923c52e9ba3fcd756f09abbab620096
|
7
|
+
data.tar.gz: be0d4ed971237392b5f8a2d81df3d4aa5b1a207e775d5a91fa30d1b6360144f4526c9f047487d637415780eee216d568faddbdaa0b4dd505e1d5d387f02af5dc
|
data/lib/sentry-sidekiq.rb
CHANGED
@@ -26,7 +26,12 @@ end
|
|
26
26
|
Sidekiq.configure_server do |config|
|
27
27
|
config.error_handlers << Sentry::Sidekiq::ErrorHandler.new
|
28
28
|
config.server_middleware do |chain|
|
29
|
-
chain.add Sentry::Sidekiq::
|
29
|
+
chain.add Sentry::Sidekiq::SentryContextServerMiddleware
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
+
Sidekiq.configure_client do |config|
|
34
|
+
config.client_middleware do |chain|
|
35
|
+
chain.add Sentry::Sidekiq::SentryContextClientMiddleware
|
36
|
+
end
|
37
|
+
end
|
@@ -2,7 +2,7 @@ require 'sentry/sidekiq/context_filter'
|
|
2
2
|
|
3
3
|
module Sentry
|
4
4
|
module Sidekiq
|
5
|
-
class
|
5
|
+
class SentryContextServerMiddleware
|
6
6
|
def call(_worker, job, queue)
|
7
7
|
return yield unless Sentry.initialized?
|
8
8
|
|
@@ -10,6 +10,9 @@ module Sentry
|
|
10
10
|
|
11
11
|
Sentry.clone_hub_to_current_thread
|
12
12
|
scope = Sentry.get_current_scope
|
13
|
+
if (user = job["sentry_user"])
|
14
|
+
scope.set_user(user)
|
15
|
+
end
|
13
16
|
scope.set_tags(queue: queue, jid: job["jid"])
|
14
17
|
scope.set_contexts(sidekiq: job.merge("queue" => queue))
|
15
18
|
scope.set_transaction_name(context_filter.transaction_name)
|
@@ -36,5 +39,15 @@ module Sentry
|
|
36
39
|
transaction.finish
|
37
40
|
end
|
38
41
|
end
|
42
|
+
|
43
|
+
class SentryContextClientMiddleware
|
44
|
+
def call(_worker_class, job, _queue, _redis_pool)
|
45
|
+
return yield unless Sentry.initialized?
|
46
|
+
|
47
|
+
user = Sentry.get_current_scope.user
|
48
|
+
job["sentry_user"] = user unless user.empty?
|
49
|
+
yield
|
50
|
+
end
|
51
|
+
end
|
39
52
|
end
|
40
53
|
end
|
data/sentry-sidekiq.gemspec
CHANGED
@@ -22,5 +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.6.0"
|
26
|
+
spec.add_dependency "sidekiq", ">= 3.0"
|
26
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.6.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: 2021-
|
11
|
+
date: 2021-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sentry-ruby-core
|
@@ -16,14 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4.
|
19
|
+
version: 4.6.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
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: sidekiq
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.0'
|
27
41
|
description: A gem that provides Sidekiq integration for the Sentry error logger
|
28
42
|
email: accounts@sentry.io
|
29
43
|
executables: []
|