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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d833126f5b35c94334521ae17b72b0e852fcd0e0f94a30abd4522afc4506ed84
4
- data.tar.gz: 16b687c8e27153593fb32147d915618fa34cf5392bba848ad988ccf7a77ec262
3
+ metadata.gz: eccd0c1d7cffe7eecd455ab2dcb303e555e609358d9949c27c328533e0df3ece
4
+ data.tar.gz: 6d9d38f849f8350b343ba1e52afb69b144a2d8524467b926a3af325e11e7312d
5
5
  SHA512:
6
- metadata.gz: e33d879d4f9e2790fdf606577274da75e0cd16f176f8c6f9dbf54a11ad93db6ef0a594d05729b594a285ef6f729f01618c82a2af406b6243d93e8c3fdbb0e3ea
7
- data.tar.gz: d623df35075019ec37dc4c497c007974c6385450cc34bb5a68a512464720741335a974989fba6b3f160feb3a349800ccc6b5dbfa22531e752b16164bf70496dd
6
+ metadata.gz: a01bddf2c4072d21f136545d0d35b1b61c12c345208839ed71df7916782a95c77f96c98da72930149e58a2b688a5630e5923c52e9ba3fcd756f09abbab620096
7
+ data.tar.gz: be0d4ed971237392b5f8a2d81df3d4aa5b1a207e775d5a91fa30d1b6360144f4526c9f047487d637415780eee216d568faddbdaa0b4dd505e1d5d387f02af5dc
@@ -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::SentryContextMiddleware
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 SentryContextMiddleware
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
@@ -1,5 +1,5 @@
1
1
  module Sentry
2
2
  module Sidekiq
3
- VERSION = "4.5.2"
3
+ VERSION = "4.6.2"
4
4
  end
5
5
  end
@@ -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.5.0"
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.5.2
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-06-24 00:00:00.000000000 Z
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.5.0
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.5.0
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: []