sentry-sidekiq 4.2.1 → 4.5.0

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: 383b3c28fc5583dadfc497ae0c3b0dc052e7909f8e71e8d8eca728f68b060aea
4
- data.tar.gz: b867a8389fbd6e44b06a7256c6dafdc68f04acf2fe4dc2e99c84f647c010e614
3
+ metadata.gz: 258de37243b829dddd8fd4726744fdb673b68ca10b5c95aeda21be5c6501a4d8
4
+ data.tar.gz: 54c354085193eabff5422efed9440eb7503a41b9fdb3e98b9c89229bb12ae3ca
5
5
  SHA512:
6
- metadata.gz: 71cd8d00dc973f0521b387ea75b2d2aa52da2078b5bbb7cd1b14533f0db944b1f387dd02a6ed0272ea7958c2fe18981c5350b24121e68e846851ae1c8b3e21d0
7
- data.tar.gz: c1c3c647df576a8ed592d90a104dd171fe99c4b6cd775ee7364b9f9cbc84489b2614d20d085abf0c7ca1b5c3e71f3f2b50e0bdaf854321fa9b192fb153127b81
6
+ metadata.gz: 5aaad1970d121845219dca6edbd183deaa00dbe4f8efbeef0e131fc6cecb898edc6b402eeb8b3dbfb5da224216bc4ab2f51a6953e676e546c10bc6a33d506517
7
+ data.tar.gz: b6155ad0e62f21a689b7d753594330ad3f218ac754ad2a37e4e399eade57fb4f4b02e66259baa7a24ef781a8f4e356946e9692bfeee128bb631c9a39d480b936
data/.craft.yml CHANGED
@@ -11,9 +11,9 @@ artifactProvider:
11
11
  name: github
12
12
  targets:
13
13
  - name: gem
14
- - name: github
15
- tagPrefix: sentry-sidekiq-v
16
14
  - name: registry
17
15
  type: sdk
18
16
  config:
19
17
  canonical: 'gem:sentry-sidekiq'
18
+ - name: github
19
+ tagPrefix: sentry-sidekiq-v
data/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # Changelog
2
2
 
3
+ Individual gem's changelog has been deprecated. Please check the [project changelog](https://github.com/getsentry/sentry-ruby/blob/master/CHANGELOG.md).
4
+
5
+ ## 4.4.0
6
+
7
+ ### Features
8
+
9
+ - Make Sidekiq job context more readable [#1410](https://github.com/getsentry/sentry-ruby/pull/1410)
10
+
11
+ **Before**
12
+
13
+ <img width="60%" alt="Sidekiq payload in extra" src="https://user-images.githubusercontent.com/5079556/115679342-0ed8d000-a385-11eb-8e1c-372cb1af572e.png">
14
+
15
+ **After**
16
+
17
+ <img width="60%" alt="Sidekiq payload in context" src="https://user-images.githubusercontent.com/5079556/115679353-126c5700-a385-11eb-867c-a9a25d1a7099.png">
18
+
19
+ ## 4.3.0
20
+
21
+ ### Features
22
+
23
+ - Support performance monitoring on Sidekiq workers [#1311](https://github.com/getsentry/sentry-ruby/pull/1311)
24
+
3
25
  ## 4.2.1
4
26
 
5
27
  - Use ::Rails::Railtie for checking Rails definition [#1284](https://github.com/getsentry/sentry-ruby/pull/1284)
data/Gemfile CHANGED
@@ -3,8 +3,7 @@ source "https://rubygems.org"
3
3
  # Specify your gem's dependencies in sentry-ruby.gemspec
4
4
  gemspec
5
5
 
6
- # TODO: Remove this if https://github.com/jruby/jruby/issues/6547 is addressed
7
- gem "i18n", "<= 1.8.7"
6
+ gem "i18n", "~> 1.8.9"
8
7
 
9
8
  gem "rake", "~> 12.0"
10
9
  gem "rspec", "~> 3.0"
data/Makefile CHANGED
@@ -1,3 +1,7 @@
1
1
  build:
2
2
  bundle install
3
3
  gem build sentry-sidekiq.gemspec
4
+
5
+ test:
6
+ bundle exec rspec
7
+ WITH_SENTRY_RAILS=1 bundle exec rspec spec/sentry/rails_spec.rb
@@ -10,6 +10,8 @@ end
10
10
  class ErrorWorker
11
11
  include Sidekiq::Worker
12
12
 
13
+ sidekiq_options retry: 0
14
+
13
15
  def perform
14
16
  1 / 0
15
17
  end
@@ -18,7 +18,15 @@ module Sentry
18
18
  # these magic reserved keys, ActiveJob will throw up and error. We want to
19
19
  # capture these and mutate the keys so we can sanely report it.
20
20
  def filtered
21
- filter_context(context)
21
+ filtered_context = filter_context(context)
22
+
23
+ if job_entry = filtered_context.delete(:job)
24
+ job_entry.each do |k, v|
25
+ filtered_context[k] = v
26
+ end
27
+ end
28
+
29
+ filtered_context
22
30
  end
23
31
 
24
32
  def transaction_name
@@ -13,7 +13,7 @@ module Sentry
13
13
 
14
14
  Sentry::Sidekiq.capture_exception(
15
15
  ex,
16
- extra: { sidekiq: context_filter.filtered },
16
+ contexts: { sidekiq: context_filter.filtered },
17
17
  hint: { background: false }
18
18
  )
19
19
  end
@@ -11,15 +11,30 @@ module Sentry
11
11
  Sentry.clone_hub_to_current_thread
12
12
  scope = Sentry.get_current_scope
13
13
  scope.set_tags(queue: queue, jid: job["jid"])
14
- scope.set_extras(sidekiq: job.merge("queue" => queue))
14
+ scope.set_contexts(sidekiq: job.merge("queue" => queue))
15
15
  scope.set_transaction_name(context_filter.transaction_name)
16
+ transaction = Sentry.start_transaction(name: scope.transaction_name, op: "sidekiq")
17
+ scope.set_span(transaction) if transaction
16
18
 
17
- yield
19
+ begin
20
+ yield
21
+ rescue => e
22
+ finish_transaction(transaction, 500)
23
+ raise
24
+ end
18
25
 
26
+ finish_transaction(transaction, 200)
19
27
  # don't need to use ensure here
20
28
  # if the job failed, we need to keep the scope for error handler. and the scope will be cleared there
21
29
  scope.clear
22
30
  end
31
+
32
+ def finish_transaction(transaction, status)
33
+ return unless transaction
34
+
35
+ transaction.set_http_status(status)
36
+ transaction.finish
37
+ end
23
38
  end
24
39
  end
25
40
  end
@@ -1,5 +1,5 @@
1
1
  module Sentry
2
2
  module Sidekiq
3
- VERSION = "4.2.1"
3
+ VERSION = "4.5.0"
4
4
  end
5
5
  end
@@ -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/sentry-sidekiq/CHANGELOG.md"
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.2.0"
25
+ spec.add_dependency "sentry-ruby-core", "~> 4.5.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.2.1
4
+ version: 4.5.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-02-18 00:00:00.000000000 Z
11
+ date: 2021-05-27 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.2.0
19
+ version: 4.5.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.2.0
26
+ version: 4.5.0
27
27
  description: A gem that provides Sidekiq integration for the Sentry error logger
28
28
  email: accounts@sentry.io
29
29
  executables: []
@@ -60,7 +60,7 @@ licenses:
60
60
  metadata:
61
61
  homepage_uri: https://github.com/getsentry/sentry-ruby
62
62
  source_code_uri: https://github.com/getsentry/sentry-ruby
63
- changelog_uri: https://github.com/getsentry/sentry-ruby/blob/master/sentry-sidekiq/CHANGELOG.md
63
+ changelog_uri: https://github.com/getsentry/sentry-ruby/blob/master/CHANGELOG.md
64
64
  post_install_message:
65
65
  rdoc_options: []
66
66
  require_paths:
@@ -76,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
78
  requirements: []
79
- rubygems_version: 3.0.3
79
+ rubygems_version: 3.1.6
80
80
  signing_key:
81
81
  specification_version: 4
82
82
  summary: A gem that provides Sidekiq integration for the Sentry error logger