sentry-sidekiq 4.6.4 → 4.7.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: 78a998035c221822dfffc307d6e200d82add8e1878567cc44cb4ddadb6d5f985
4
- data.tar.gz: cb70fdb289d9d8f044ed3ccaee682c83b177828d101d9c423431ba18dbfecaee
3
+ metadata.gz: bdf23944483ee1cd2326aa006a9e571a55bcc4ae6236933b522f43b60d5133ee
4
+ data.tar.gz: bf74d3c1c26831a66cf0c6a19dd74c52e03579ba5c3140c0cd89bdeb9259f9e8
5
5
  SHA512:
6
- metadata.gz: 9dd2e3a65b2d4ebff26311e8c0bce933e8f2ec38cbf523cf16ba1703e18f27045c90d56e47bf92c110c53753e439013d25302f3efacdc8c67a901b04c68b3c9f
7
- data.tar.gz: 0d7d07596e1f529f818114706a48554fa41039c9066cd3ae54b4931f8a8ca18cd63102f62fd6dbd12d2d0a4b2691fa9319b721613d9d9a858d56fb51a45e2458
6
+ metadata.gz: a405d079263c93631e7f1ba7b2929eaf553033e599364bbb798d0be735525e6a13f6b0f5c80e11fd7eb69ce723b0972d1ae93f36ff97b402287e8aeef1567a37
7
+ data.tar.gz: 73837bd36ca00e0acb667a9582e5a750b03ab377e00b4abfb769e56bee6da16469ac751e951f2e88e408e0bd5e94fa8115c956c080e4240f106b9be814b5d180
data/Gemfile CHANGED
@@ -7,8 +7,11 @@ gem "rake", "~> 12.0"
7
7
  gem "rspec", "~> 3.0"
8
8
  gem "codecov", "0.2.12"
9
9
 
10
- gem "sidekiq"
10
+ sidekiq_version = ENV["SIDEKIQ_VERSION"]
11
+ sidekiq_version = "6.0" if sidekiq_version.nil?
12
+
11
13
  gem "rails"
14
+ gem "sidekiq", "~> #{sidekiq_version}"
12
15
 
13
16
  gem "sentry-ruby", path: "../sentry-ruby"
14
17
  gem "sentry-rails", path: "../sentry-rails"
@@ -16,3 +19,4 @@ gem "sentry-rails", path: "../sentry-rails"
16
19
  gem "object_tracer"
17
20
  gem "debug", github: "ruby/debug" if RUBY_VERSION.to_f >= 2.6
18
21
  gem "pry"
22
+
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2020 st0012
3
+ Copyright (c) 2020 Sentry
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -0,0 +1,21 @@
1
+ module Sentry
2
+ class Configuration
3
+ attr_reader :sidekiq
4
+
5
+ add_post_initialization_callback do
6
+ @sidekiq = Sentry::Sidekiq::Configuration.new
7
+ end
8
+ end
9
+
10
+ module Sidekiq
11
+ class Configuration
12
+ # Set this option to true if you want Sentry to only capture the last job
13
+ # retry if it fails.
14
+ attr_accessor :report_after_job_retries
15
+
16
+ def initialize
17
+ @report_after_job_retries = false
18
+ end
19
+ end
20
+ end
21
+ end
@@ -11,6 +11,15 @@ module Sentry
11
11
  scope = Sentry.get_current_scope
12
12
  scope.set_transaction_name(context_filter.transaction_name) unless scope.transaction_name
13
13
 
14
+ retry_option = context.dig(:job, "retry")
15
+
16
+ if Sentry.configuration.sidekiq.report_after_job_retries && retry_option.is_a?(Integer) && retry_option.positive?
17
+ retry_count = context.dig(:job, "retry_count")
18
+ if retry_count.nil? || retry_count < retry_option - 1
19
+ return
20
+ end
21
+ end
22
+
14
23
  Sentry::Sidekiq.capture_exception(
15
24
  ex,
16
25
  contexts: { sidekiq: context_filter.filtered },
@@ -1,5 +1,5 @@
1
1
  module Sentry
2
2
  module Sidekiq
3
- VERSION = "4.6.4"
3
+ VERSION = "4.7.2"
4
4
  end
5
5
  end
@@ -2,6 +2,7 @@ require "sidekiq"
2
2
  require "sentry-ruby"
3
3
  require "sentry/integrable"
4
4
  require "sentry/sidekiq/version"
5
+ require "sentry/sidekiq/configuration"
5
6
  require "sentry/sidekiq/error_handler"
6
7
  require "sentry/sidekiq/sentry_context_middleware"
7
8
 
@@ -14,7 +15,7 @@ module Sentry
14
15
  if defined?(::Rails::Railtie)
15
16
  class Railtie < ::Rails::Railtie
16
17
  config.after_initialize do
17
- next unless Sentry.initialized?
18
+ next unless Sentry.initialized? && defined?(::Sentry::Rails)
18
19
 
19
20
  Sentry.configuration.rails.skippable_job_adapters << "ActiveJob::QueueAdapters::SidekiqAdapter"
20
21
  end
@@ -6,7 +6,7 @@ Gem::Specification.new do |spec|
6
6
  spec.authors = ["Sentry Team"]
7
7
  spec.description = spec.summary = "A gem that provides Sidekiq integration for the Sentry error logger"
8
8
  spec.email = "accounts@sentry.io"
9
- spec.license = 'Apache-2.0'
9
+ spec.license = 'MIT'
10
10
  spec.homepage = "https://github.com/getsentry/sentry-ruby"
11
11
 
12
12
  spec.platform = Gem::Platform::RUBY
@@ -22,6 +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.6.0"
25
+ spec.add_dependency "sentry-ruby-core", "~> 4.7.0"
26
26
  spec.add_dependency "sidekiq", ">= 3.0"
27
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.6.4
4
+ version: 4.7.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-07-29 00:00:00.000000000 Z
11
+ date: 2021-09-09 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.6.0
19
+ version: 4.7.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.6.0
26
+ version: 4.7.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sidekiq
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -62,6 +62,7 @@ files:
62
62
  - example/config/sidekiq.yml
63
63
  - example/error_worker.rb
64
64
  - lib/sentry-sidekiq.rb
65
+ - lib/sentry/sidekiq/configuration.rb
65
66
  - lib/sentry/sidekiq/context_filter.rb
66
67
  - lib/sentry/sidekiq/error_handler.rb
67
68
  - lib/sentry/sidekiq/sentry_context_middleware.rb
@@ -69,7 +70,7 @@ files:
69
70
  - sentry-sidekiq.gemspec
70
71
  homepage: https://github.com/getsentry/sentry-ruby
71
72
  licenses:
72
- - Apache-2.0
73
+ - MIT
73
74
  metadata:
74
75
  homepage_uri: https://github.com/getsentry/sentry-ruby
75
76
  source_code_uri: https://github.com/getsentry/sentry-ruby