sentry-sidekiq 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/Gemfile +2 -2
- 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 -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: a42579a47b6f4a2725f4cccbc9c953d2c41748d7bf6a6f405e2fd9bab275ab90
|
4
|
+
data.tar.gz: baaf1904b64cc97622169fd34f5205469eef0c2da7e8e070bf1864e3b3d92ad1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6814888d79aa842348d3cb9c6aaa3c154c8f394f35efc3b4114c924a99f7905fa88dc5cab467acd94464f32bb6e858b2eee47a05ac4bf4510bf06b3b0823a548
|
7
|
+
data.tar.gz: 13fb14f0cfe6e69ee736e0b473bad4ead5ffac087856e5a4db4aafe2841d9d0a620de073658d05bf2686acf1a024d1b04b6bc80367f354e60f86844365475e8c
|
data/CHANGELOG.md
CHANGED
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"
|
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
@@ -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-sidekiq
|
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 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
|
@@ -60,7 +59,7 @@ licenses:
|
|
60
59
|
metadata:
|
61
60
|
homepage_uri: https://github.com/getsentry/sentry-ruby
|
62
61
|
source_code_uri: https://github.com/getsentry/sentry-ruby
|
63
|
-
changelog_uri: https://github.com/getsentry/sentry-ruby/blob/master/
|
62
|
+
changelog_uri: https://github.com/getsentry/sentry-ruby/blob/master/CHANGELOG.md
|
64
63
|
post_install_message:
|
65
64
|
rdoc_options: []
|
66
65
|
require_paths:
|
@@ -72,11 +71,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
72
71
|
version: '2.4'
|
73
72
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
73
|
requirements:
|
75
|
-
- - "
|
74
|
+
- - ">"
|
76
75
|
- !ruby/object:Gem::Version
|
77
|
-
version:
|
76
|
+
version: 1.3.1
|
78
77
|
requirements: []
|
79
|
-
rubygems_version: 3.
|
78
|
+
rubygems_version: 3.1.6
|
80
79
|
signing_key:
|
81
80
|
specification_version: 4
|
82
81
|
summary: A gem that provides Sidekiq 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-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
|
20
|
-
changelog: sentry-sidekiq/CHANGELOG.md
|