sentry-sidekiq 4.5.0 → 4.6.1

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: 258de37243b829dddd8fd4726744fdb673b68ca10b5c95aeda21be5c6501a4d8
4
- data.tar.gz: 54c354085193eabff5422efed9440eb7503a41b9fdb3e98b9c89229bb12ae3ca
3
+ metadata.gz: 145643c4a22bad5b91480c1e721ccdc83f47b72fa9c6b73c0beea6eaaf544028
4
+ data.tar.gz: 9fb7f16bb1c025f482bf175d9ae58bd293a4961f4656dac2ded0e7454ff03b70
5
5
  SHA512:
6
- metadata.gz: 5aaad1970d121845219dca6edbd183deaa00dbe4f8efbeef0e131fc6cecb898edc6b402eeb8b3dbfb5da224216bc4ab2f51a6953e676e546c10bc6a33d506517
7
- data.tar.gz: b6155ad0e62f21a689b7d753594330ad3f218ac754ad2a37e4e399eade57fb4f4b02e66259baa7a24ef781a8f4e356946e9692bfeee128bb631c9a39d480b936
6
+ metadata.gz: ec1224f6096621b8c7ebe7b1070af8b2524ffc389177a85f96e01ffcc056a1f5ab8ca2813ebb33ef6e4d7dbfe8036acde4a58d09b7e4956d482540e34a520910
7
+ data.tar.gz: 46c4aaf1c8c5ee079c79aebb950923bb2d4b8f4933e53697941404180b5690f487580a4ce179c7e77f9fce96bf9f43e641396cc315f949d949318fda2833b4e6
data/Gemfile CHANGED
@@ -3,8 +3,6 @@ source "https://rubygems.org"
3
3
  # Specify your gem's dependencies in sentry-ruby.gemspec
4
4
  gemspec
5
5
 
6
- gem "i18n", "~> 1.8.9"
7
-
8
6
  gem "rake", "~> 12.0"
9
7
  gem "rspec", "~> 3.0"
10
8
  gem "codecov", "0.2.12"
@@ -15,4 +13,6 @@ gem "rails"
15
13
  gem "sentry-ruby", path: "../sentry-ruby"
16
14
  gem "sentry-rails", path: "../sentry-rails"
17
15
 
16
+ gem "object_tracer"
17
+ gem "debug", github: "ruby/debug" if RUBY_VERSION.to_f >= 2.6
18
18
  gem "pry"
@@ -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.0"
3
+ VERSION = "4.6.1"
4
4
  end
5
5
  end
@@ -22,5 +22,5 @@ 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
26
  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.0
4
+ version: 4.6.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-05-27 00:00:00.000000000 Z
11
+ date: 2021-07-08 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.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
27
  description: A gem that provides Sidekiq 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
data/.craft.yml DELETED
@@ -1,19 +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-sidekiq
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-sidekiq'
18
- - name: github
19
- tagPrefix: sentry-sidekiq-v