sentry-sidekiq 0.1.3 → 4.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +23 -0
- data/Gemfile +1 -1
- data/README.md +2 -1
- data/lib/sentry-sidekiq.rb +5 -6
- data/lib/sentry/sidekiq/cleanup_middleware.rb +3 -1
- data/lib/sentry/sidekiq/error_handler.rb +8 -7
- data/lib/sentry/sidekiq/sentry_context_middleware.rb +20 -0
- data/lib/sentry/sidekiq/version.rb +1 -1
- data/sentry-sidekiq.gemspec +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4370fdcec568ea785e549d24e250575ad8bb93b7a46bd27e777e9c6776407a57
|
4
|
+
data.tar.gz: 99a527bf321e1645843a159f9706ea8215976485833b8c20dcb243b56bce6016
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fdd057e634833b1ee467af9800ba759d2bca7a88ae9a1a8f84d844c8afa99b6aeb5d241b3f267275b5e42176c56943286a2b89407f5b7cc135fac520d04e833
|
7
|
+
data.tar.gz: 53ca304f50dc403af8a7f5d7011c2d1d6850ce111859796bac193736b8c6a5778428822db519eae7c0e412290a56b709e09fd59031093613b089b96379f9d38c
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,28 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 4.1.2
|
4
|
+
|
5
|
+
- Fix sidekiq middleware [#1175](https://github.com/getsentry/sentry-ruby/pull/1175)
|
6
|
+
- Fixes [#1173](https://github.com/getsentry/sentry-ruby/issues/1173)
|
7
|
+
- Adopt Integrable module [#1177](https://github.com/getsentry/sentry-ruby/pull/1177)
|
8
|
+
|
9
|
+
## 4.1.1
|
10
|
+
|
11
|
+
- Use stricter dependency declaration [#1159](https://github.com/getsentry/sentry-ruby/pull/1159)
|
12
|
+
|
13
|
+
## 4.1.0
|
14
|
+
|
15
|
+
- Check SDK initialization before running integrations [#1151](https://github.com/getsentry/sentry-ruby/pull/1151)
|
16
|
+
- Fixes [#1145](https://github.com/getsentry/sentry-ruby/pull/1145)
|
17
|
+
|
18
|
+
## 4.0.0
|
19
|
+
|
20
|
+
- Only documents update for the official release and no API/feature changes.
|
21
|
+
|
22
|
+
## 0.2.0
|
23
|
+
|
24
|
+
- Major API changes: [1123](https://github.com/getsentry/sentry-ruby/pull/1123)
|
25
|
+
|
3
26
|
## 0.1.3
|
4
27
|
|
5
28
|
- Small fixes
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -17,7 +17,7 @@
|
|
17
17
|
[![SemVer](https://api.dependabot.com/badges/compatibility_score?dependency-name=sentry-sidekiq&package-manager=bundler&version-scheme=semver)](https://dependabot.com/compatibility-score.html?dependency-name=sentry-sidekiq&package-manager=bundler&version-scheme=semver)
|
18
18
|
|
19
19
|
|
20
|
-
[Documentation](https://docs.sentry.io/
|
20
|
+
[Documentation](https://docs.sentry.io/platforms/ruby/guides/sidekiq/) | [Bug Tracker](https://github.com/getsentry/sentry-ruby/issues) | [Forum](https://forum.sentry.io/) | IRC: irc.freenode.net, #sentry
|
21
21
|
|
22
22
|
The official Ruby-language client and integration layer for the [Sentry](https://github.com/getsentry/sentry) error reporting API.
|
23
23
|
|
@@ -27,6 +27,7 @@ The official Ruby-language client and integration layer for the [Sentry](https:/
|
|
27
27
|
### Install
|
28
28
|
|
29
29
|
```ruby
|
30
|
+
gem "sentry-ruby"
|
30
31
|
gem "sentry-sidekiq"
|
31
32
|
```
|
32
33
|
|
data/lib/sentry-sidekiq.rb
CHANGED
@@ -1,24 +1,23 @@
|
|
1
1
|
require "sidekiq"
|
2
2
|
require "sentry-ruby"
|
3
|
+
require "sentry/integrable"
|
3
4
|
require "sentry/sidekiq/version"
|
4
5
|
require "sentry/sidekiq/error_handler"
|
5
|
-
require "sentry/sidekiq/
|
6
|
+
require "sentry/sidekiq/sentry_context_middleware"
|
6
7
|
# require "sentry/sidekiq/configuration"
|
7
8
|
|
8
9
|
module Sentry
|
9
10
|
module Sidekiq
|
10
|
-
|
11
|
-
end
|
11
|
+
extend Sentry::Integrable
|
12
12
|
|
13
|
-
|
14
|
-
Sentry::Sidekiq::META
|
13
|
+
register_integration name: "sidekiq", version: Sentry::Sidekiq::VERSION
|
15
14
|
end
|
16
15
|
end
|
17
16
|
|
18
17
|
Sidekiq.configure_server do |config|
|
19
18
|
config.error_handlers << Sentry::Sidekiq::ErrorHandler.new
|
20
19
|
config.server_middleware do |chain|
|
21
|
-
chain.add Sentry::Sidekiq::
|
20
|
+
chain.add Sentry::Sidekiq::SentryContextMiddleware
|
22
21
|
end
|
23
22
|
end
|
24
23
|
|
@@ -2,6 +2,8 @@ module Sentry
|
|
2
2
|
module Sidekiq
|
3
3
|
class CleanupMiddleware
|
4
4
|
def call(_worker, job, queue)
|
5
|
+
return yield unless Sentry.initialized?
|
6
|
+
|
5
7
|
Sentry.clone_hub_to_current_thread
|
6
8
|
Sentry.with_scope do |scope|
|
7
9
|
scope.set_extras(sidekiq: job.merge("queue" => queue))
|
@@ -10,7 +12,7 @@ module Sentry
|
|
10
12
|
begin
|
11
13
|
yield
|
12
14
|
rescue => ex
|
13
|
-
Sentry.capture_exception(ex)
|
15
|
+
Sentry::Sidekiq.capture_exception(ex, hint: { background: false })
|
14
16
|
end
|
15
17
|
end
|
16
18
|
end
|
@@ -6,15 +6,16 @@ module Sentry
|
|
6
6
|
SIDEKIQ_NAME = "Sidekiq".freeze
|
7
7
|
|
8
8
|
def call(ex, context)
|
9
|
+
return unless Sentry.initialized?
|
9
10
|
context = Sentry::Sidekiq::ContextFilter.new.filter_context(context)
|
11
|
+
scope = Sentry.get_current_scope
|
12
|
+
scope.set_transaction_name(transaction_from_context(context)) unless scope.transaction_name
|
10
13
|
|
11
|
-
Sentry.
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
)
|
17
|
-
end
|
14
|
+
Sentry::Sidekiq.capture_exception(
|
15
|
+
ex,
|
16
|
+
extra: { sidekiq: context },
|
17
|
+
hint: { background: false }
|
18
|
+
)
|
18
19
|
end
|
19
20
|
|
20
21
|
private
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Sentry
|
2
|
+
module Sidekiq
|
3
|
+
class SentryContextMiddleware
|
4
|
+
def call(_worker, job, queue)
|
5
|
+
return yield unless Sentry.initialized?
|
6
|
+
|
7
|
+
Sentry.clone_hub_to_current_thread
|
8
|
+
scope = Sentry.get_current_scope
|
9
|
+
scope.set_extras(sidekiq: job.merge("queue" => queue))
|
10
|
+
scope.set_transaction_name("Sidekiq/#{job["class"]}")
|
11
|
+
|
12
|
+
yield
|
13
|
+
|
14
|
+
# don't need to use ensure here
|
15
|
+
# if the job failed, we need to keep the scope for error handler. and the scope will be cleared there
|
16
|
+
scope.clear
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/sentry-sidekiq.gemspec
CHANGED
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sentry-sidekiq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.1.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: 2020-
|
11
|
+
date: 2020-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sentry-ruby
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 4.1.2
|
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:
|
26
|
+
version: 4.1.2
|
27
27
|
description: A gem that provides Sidekiq integration for the Sentry error logger
|
28
28
|
email: accounts@sentry.io
|
29
29
|
executables: []
|
@@ -52,6 +52,7 @@ files:
|
|
52
52
|
- lib/sentry/sidekiq/cleanup_middleware.rb
|
53
53
|
- lib/sentry/sidekiq/context_filter.rb
|
54
54
|
- lib/sentry/sidekiq/error_handler.rb
|
55
|
+
- lib/sentry/sidekiq/sentry_context_middleware.rb
|
55
56
|
- lib/sentry/sidekiq/version.rb
|
56
57
|
- sentry-sidekiq.gemspec
|
57
58
|
homepage: https://github.com/getsentry/sentry-ruby
|