sentry-sidekiq-5.28.0/0000755000004100000410000000000015070004776014617 5ustar www-datawww-datasentry-sidekiq-5.28.0/bin/0000755000004100000410000000000015070004776015367 5ustar www-datawww-datasentry-sidekiq-5.28.0/bin/setup0000755000004100000410000000020315070004776016450 0ustar www-datawww-data#!/usr/bin/env bash set -euo pipefail IFS=$'\n\t' set -vx bundle install # Do any other automated setup that you need to do here sentry-sidekiq-5.28.0/bin/console0000755000004100000410000000057015070004776016761 0ustar www-datawww-data#!/usr/bin/env ruby # frozen_string_literal: true require "bundler/setup" require "sentry/ruby" # You can add fixtures and/or initialization code here to make experimenting # with your gem easier. You can also use a different console, if you like. # (If you use this, don't forget to add pry to your Gemfile!) # require "pry" # Pry.start require "irb" IRB.start(__FILE__) sentry-sidekiq-5.28.0/.gitignore0000644000004100000410000000016115070004776016605 0ustar www-datawww-data/.bundle/ /.yardoc /_yardoc/ /coverage/ /doc/ /pkg/ /spec/reports/ /tmp/ # rspec failure tracking .rspec_status sentry-sidekiq-5.28.0/example/0000755000004100000410000000000015070004776016252 5ustar www-datawww-datasentry-sidekiq-5.28.0/example/error_worker.rb0000644000004100000410000000063415070004776021324 0ustar www-datawww-data# frozen_string_literal: true require "sidekiq" require "sentry-sidekiq" Sentry.init do |config| config.breadcrumbs_logger = [:sentry_logger] # replace it with your sentry dsn config.dsn = 'https://2fb45f003d054a7ea47feb45898f7649@o447951.ingest.sentry.io/5434472' end class ErrorWorker include Sidekiq::Worker sidekiq_options retry: 0 def perform 1 / 0 end end ErrorWorker.perform_async sentry-sidekiq-5.28.0/example/Gemfile0000644000004100000410000000027615070004776017552 0ustar www-datawww-data# frozen_string_literal: true source "https://rubygems.org" gem "sidekiq" gem "sentry-sidekiq", path: "../" gem "sentry-ruby", path: "../../sentry-ruby" gem "debug", github: "ruby/debug" sentry-sidekiq-5.28.0/example/README.md0000644000004100000410000000032215070004776017526 0ustar www-datawww-data# sentry-sidekiq example ## Usage 1. run `bundle install` 2. change the `dsn` inside `error_worker.rb` 3. run `bundle exec sidekiq -r ./error_worker.rb` 4. you should see the event from your Sentry dashboard sentry-sidekiq-5.28.0/example/config/0000755000004100000410000000000015070004776017517 5ustar www-datawww-datasentry-sidekiq-5.28.0/example/config/sidekiq.yml0000644000004100000410000000011115070004776021664 0ustar www-datawww-data--- :verbose: false :concurrency: 10 :timeout: 25 :queues: - default sentry-sidekiq-5.28.0/lib/0000755000004100000410000000000015070004776015365 5ustar www-datawww-datasentry-sidekiq-5.28.0/lib/sentry/0000755000004100000410000000000015070004776016711 5ustar www-datawww-datasentry-sidekiq-5.28.0/lib/sentry/sidekiq-scheduler/0000755000004100000410000000000015070004776022316 5ustar www-datawww-datasentry-sidekiq-5.28.0/lib/sentry/sidekiq-scheduler/scheduler.rb0000644000004100000410000000466715070004776024636 0ustar www-datawww-data# frozen_string_literal: true # Try to require sidekiq-scheduler to make sure it's loaded before the integration. begin require "sidekiq-scheduler" rescue LoadError return end # If we've loaded sidekiq-scheduler, but the API changed, # and the Scheduler class is not there, fail gracefully. return unless defined?(::SidekiqScheduler::Scheduler) module Sentry module SidekiqScheduler module Scheduler def new_job(name, interval_type, config, schedule, options) # Schedule the job upstream first # SidekiqScheduler does not validate schedules # It will fail with an error if the schedule in the config is invalid. # If this errors out, let it fall through. rufus_job = super klass = config.fetch("class") return rufus_job unless klass # Constantize the job class, and fail gracefully if it could not be found klass_const = begin Object.const_get(klass) rescue NameError return rufus_job end # For cron, every, or interval jobs — grab their schedule. # Rufus::Scheduler::EveryJob stores it's frequency in seconds, # so we convert it to minutes before passing in to the monitor. monitor_config = case interval_type when "cron" Sentry::Sidekiq::Cron::Helpers.monitor_config(schedule) when "every", "interval" Sentry::Cron::MonitorConfig.from_interval(rufus_job.frequency.to_i / 60, :minute) end # If we couldn't build a monitor config, it's either an error, or # it's a one-time job (interval_type is in, or at), in which case # we should not make a monitof for it automaticaly. return rufus_job if monitor_config.nil? # only patch if not explicitly included in job by user unless klass_const.send(:ancestors).include?(Sentry::Cron::MonitorCheckIns) klass_const.send(:include, Sentry::Cron::MonitorCheckIns) slug = klass_const.send(:sentry_monitor_slug, name: name) klass_const.send(:sentry_monitor_check_ins, slug: slug, monitor_config: monitor_config) ::Sidekiq.logger.info "Injected Sentry Crons monitor checkins into #{klass}" end rufus_job end end end end Sentry.register_patch(:sidekiq_scheduler, Sentry::SidekiqScheduler::Scheduler, ::SidekiqScheduler::Scheduler) sentry-sidekiq-5.28.0/lib/sentry/sidekiq/0000755000004100000410000000000015070004776020342 5ustar www-datawww-datasentry-sidekiq-5.28.0/lib/sentry/sidekiq/configuration.rb0000644000004100000410000000177315070004776023546 0ustar www-datawww-data# frozen_string_literal: true module Sentry class Configuration attr_reader :sidekiq add_post_initialization_callback do @sidekiq = Sentry::Sidekiq::Configuration.new @excluded_exceptions = @excluded_exceptions.concat(Sentry::Sidekiq::IGNORE_DEFAULT) end end module Sidekiq IGNORE_DEFAULT = [ "Sidekiq::JobRetry::Skip", "Sidekiq::JobRetry::Handled" ] class Configuration # Set this option to true if you want Sentry to only capture the last job # retry if it fails. attr_accessor :report_after_job_retries # Only report jobs that don't have `dead: false` set in the job's `sidekiq_options` attr_accessor :report_only_dead_jobs # Whether we should inject headers while enqueuing the job in order to have a connected trace attr_accessor :propagate_traces def initialize @report_after_job_retries = false @report_only_dead_jobs = false @propagate_traces = true end end end end sentry-sidekiq-5.28.0/lib/sentry/sidekiq/sentry_context_middleware.rb0000644000004100000410000000735115070004776026162 0ustar www-datawww-data# frozen_string_literal: true require "sentry/sidekiq/context_filter" module Sentry module Sidekiq module Helpers def set_span_data(span, id:, queue:, latency: nil, retry_count: nil) return unless span span.set_data(Span::DataConventions::MESSAGING_MESSAGE_ID, id) span.set_data(Span::DataConventions::MESSAGING_DESTINATION_NAME, queue) span.set_data(Span::DataConventions::MESSAGING_MESSAGE_RECEIVE_LATENCY, latency) if latency span.set_data(Span::DataConventions::MESSAGING_MESSAGE_RETRY_COUNT, retry_count) if retry_count end if ::Gem::Version.new(::Sidekiq::VERSION) >= ::Gem::Version.new("8.0.0") def calculate_latency(job) now_in_ms - job["enqueued_at"] if job["enqueued_at"] end else def calculate_latency(job) ((Time.now.to_f - job["enqueued_at"]) * 1000).round if job["enqueued_at"] end end def now_in_ms ::Process.clock_gettime(::Process::CLOCK_REALTIME, :millisecond) end end class SentryContextServerMiddleware include Sentry::Sidekiq::Helpers OP_NAME = "queue.process" SPAN_ORIGIN = "auto.queue.sidekiq" def call(worker, job, queue) return yield unless Sentry.initialized? context_filter = Sentry::Sidekiq::ContextFilter.new(job) Sentry.clone_hub_to_current_thread scope = Sentry.get_current_scope if (user = job["sentry_user"]) scope.set_user(user) end scope.set_tags(queue: queue, jid: job["jid"]) scope.set_tags(build_tags(job["tags"])) scope.set_contexts(sidekiq: job.merge("queue" => queue)) scope.set_transaction_name(context_filter.transaction_name, source: :task) transaction = start_transaction(scope, job["trace_propagation_headers"]) if transaction scope.set_span(transaction) latency = calculate_latency(job) set_span_data( transaction, id: job["jid"], queue: queue, latency: latency, retry_count: job["retry_count"] || 0 ) end begin yield rescue finish_transaction(transaction, 500) raise end finish_transaction(transaction, 200) # don't need to use ensure here # if the job failed, we need to keep the scope for error handler. and the scope will be cleared there scope.clear end def build_tags(tags) Array(tags).each_with_object({}) { |name, tags_hash| tags_hash[:"sidekiq.#{name}"] = true } end def start_transaction(scope, env) options = { name: scope.transaction_name, source: scope.transaction_source, op: OP_NAME, origin: SPAN_ORIGIN } transaction = Sentry.continue_trace(env, **options) Sentry.start_transaction(transaction: transaction, **options) end def finish_transaction(transaction, status) return unless transaction transaction.set_http_status(status) transaction.finish end end class SentryContextClientMiddleware include Sentry::Sidekiq::Helpers def call(worker_class, job, queue, _redis_pool) return yield unless Sentry.initialized? user = Sentry.get_current_scope.user job["sentry_user"] = user unless user.empty? if Sentry.configuration.sidekiq.propagate_traces job["trace_propagation_headers"] ||= Sentry.get_trace_propagation_headers end Sentry.with_child_span(op: "queue.publish", description: worker_class.to_s) do |span| set_span_data(span, id: job["jid"], queue: queue) yield end end end end end sentry-sidekiq-5.28.0/lib/sentry/sidekiq/cron/0000755000004100000410000000000015070004776021303 5ustar www-datawww-datasentry-sidekiq-5.28.0/lib/sentry/sidekiq/cron/helpers.rb0000644000004100000410000000111415070004776023267 0ustar www-datawww-data# frozen_string_literal: true module Sentry module Sidekiq module Cron module Helpers # This is used by Cron::Job and Scheduler def self.monitor_config(cron) cron_parts = cron.strip.split(" ") if cron_parts.length > 5 timezone = cron_parts.pop cron_without_timezone = cron_parts.join(" ") Sentry::Cron::MonitorConfig.from_crontab(cron_without_timezone, timezone: timezone) else Sentry::Cron::MonitorConfig.from_crontab(cron) end end end end end end sentry-sidekiq-5.28.0/lib/sentry/sidekiq/cron/job.rb0000644000004100000410000000526615070004776022413 0ustar www-datawww-data# frozen_string_literal: true # Try requiring sidekiq-cron to ensure it's loaded before the integration. # If sidekiq-cron is not available, do nothing. begin require "sidekiq-cron" rescue LoadError return end module Sentry module Sidekiq module Cron module Job def self.enqueueing_method ::Sidekiq::Cron::Job.instance_methods.include?(:enque!) ? :enque! : :enqueue! end define_method(enqueueing_method) do |*args| # make sure the current thread has a clean hub Sentry.clone_hub_to_current_thread Sentry.with_scope do |scope| Sentry.with_session_tracking do begin scope.set_transaction_name("#{name} (#{klass})") transaction = start_transaction(scope) scope.set_span(transaction) if transaction super(*args) finish_transaction(transaction, 200) rescue finish_transaction(transaction, 500) raise end end end end def save # validation failed, do nothing return false unless super # fail gracefully if can't find class klass_const = begin if ::Sidekiq::Cron::Support.respond_to?(:safe_constantize) ::Sidekiq::Cron::Support.safe_constantize(klass.to_s) else ::Sidekiq::Cron::Support.constantize(klass.to_s) end rescue NameError return true end return true if klass_const.nil? # Sidekiq::Cron returns nil if class is not found # only patch if not explicitly included in job by user unless klass_const.send(:ancestors).include?(Sentry::Cron::MonitorCheckIns) klass_const.send(:include, Sentry::Cron::MonitorCheckIns) klass_const.send(:sentry_monitor_check_ins, slug: name.to_s, monitor_config: Sentry::Sidekiq::Cron::Helpers.monitor_config(parsed_cron.original)) end true end def start_transaction(scope) Sentry.start_transaction( name: scope.transaction_name, source: scope.transaction_source, op: "queue.sidekiq-cron", origin: "auto.queue.sidekiq.cron" ) end def finish_transaction(transaction, status_code) return unless transaction transaction.set_http_status(status_code) transaction.finish end end end end end Sentry.register_patch(:sidekiq_cron, Sentry::Sidekiq::Cron::Job, ::Sidekiq::Cron::Job) sentry-sidekiq-5.28.0/lib/sentry/sidekiq/error_handler.rb0000644000004100000410000000673515070004776023530 0ustar www-datawww-data# frozen_string_literal: true require "sentry/sidekiq/context_filter" module Sentry module Sidekiq class ErrorHandler WITH_SIDEKIQ_7 = ::Gem::Version.new(::Sidekiq::VERSION) >= ::Gem::Version.new("7.0") # @param ex [Exception] the exception / error that occured # @param context [Hash or Array] Sidekiq error context # @param sidekiq_config [Sidekiq::Config, Hash] Sidekiq configuration, # Defaults to nil. # Sidekiq will pass the config in starting Sidekiq 7.1.5, see # https://github.com/sidekiq/sidekiq/pull/6051 def call(ex, context, sidekiq_config = nil) return unless Sentry.initialized? context_filter = Sentry::Sidekiq::ContextFilter.new(context) scope = Sentry.get_current_scope scope.set_transaction_name(context_filter.transaction_name, source: :task) unless scope.transaction_name # If Sentry is configured to only report an error _after_ all retries have been exhausted, # and if the job is retryable, and have not exceeded the retry_limit, # return early. if Sentry.configuration.sidekiq.report_after_job_retries && retryable?(context) retry_count = context.dig(:job, "retry_count") if retry_count.nil? || retry_count < retry_limit(context, sidekiq_config) - 1 return end end # See if we want to ignore jobs that have dead: false return if Sentry.configuration.sidekiq.report_only_dead_jobs && context.dig(:job, "dead") == false # Check if the retry count is below the attempt_threshold attempt_threshold = context.dig(:job, "attempt_threshold") if attempt_threshold && retryable?(context) attempt_threshold = attempt_threshold.to_i retry_count = context.dig(:job, "retry_count") # attempt 1 - retry_count is nil # attempt 2 - this is your first retry so retry_count is 0 # attempt 3 - you have retried once, retry_count is 1 attempt = retry_count.nil? ? 1 : retry_count.to_i + 2 return if attempt < attempt_threshold end Sentry::Sidekiq.capture_exception( ex, contexts: { sidekiq: context_filter.filtered }, hint: { background: false } ) ensure scope&.clear end private def retryable?(context) retry_option = context.dig(:job, "retry") # when `retry` is not specified, it's default is `true` and it means 25 retries. retry_option == true || (retry_option.is_a?(Integer) && retry_option.positive?) end # @return [Integer] the number of retries allowed for the job # Tries to fetch the retry limit from the job config first, # then falls back to Sidekiq's configuration. def retry_limit(context, sidekiq_config) limit = context.dig(:job, "retry") case limit when Integer limit when TrueClass max_retries = if WITH_SIDEKIQ_7 # Sidekiq 7.1.5+ passes the config to the error handler, so we should use that. # Sidekiq 7.0 -> 7.1.5 provides ::Sidekiq.default_configuration. sidekiq_config.is_a?(::Sidekiq::Config) ? sidekiq_config[:max_retries] : ::Sidekiq.default_configuration[:max_retries] else ::Sidekiq.options[:max_retries] end max_retries || 25 else 0 end end end end end sentry-sidekiq-5.28.0/lib/sentry/sidekiq/version.rb0000644000004100000410000000013715070004776022355 0ustar www-datawww-data# frozen_string_literal: true module Sentry module Sidekiq VERSION = "5.28.0" end end sentry-sidekiq-5.28.0/lib/sentry/sidekiq/context_filter.rb0000644000004100000410000000432515070004776023724 0ustar www-datawww-data# frozen_string_literal: true module Sentry module Sidekiq class ContextFilter ACTIVEJOB_RESERVED_PREFIX_REGEX = /^_aj_/ SIDEKIQ_NAME = "Sidekiq" attr_reader :context def initialize(context) @context = context @has_global_id = defined?(GlobalID) end # Once an ActiveJob is queued, ActiveRecord references get serialized into # some internal reserved keys, such as _aj_globalid. # # The problem is, if this job in turn gets queued back into ActiveJob with # these magic reserved keys, ActiveJob will throw up and error. We want to # capture these and mutate the keys so we can sanely report it. def filtered filtered_context = filter_context(context) if job_entry = filtered_context.delete(:job) job_entry.each do |k, v| filtered_context[k] = v end end # Sidekiq 7.0 started adding `_config` to the context, which is not easily serialisable # And it's presence could be confusing so it's better to remove it until we decided to add it for a reason filtered_context.delete(:_config) filtered_context end def transaction_name class_name = (context["wrapped"] || context["class"] || (context[:job] && (context[:job]["wrapped"] || context[:job]["class"])) ) if class_name "#{SIDEKIQ_NAME}/#{class_name}" elsif context[:event] "#{SIDEKIQ_NAME}/#{context[:event]}" else SIDEKIQ_NAME end end private def filter_context(hash) case hash when Array hash.map { |arg| filter_context(arg) } when Hash Hash[hash.map { |key, value| filter_context_hash(key, value) }] else if has_global_id? && hash.is_a?(GlobalID) hash.to_s else hash end end end def filter_context_hash(key, value) key = key.to_s.sub(ACTIVEJOB_RESERVED_PREFIX_REGEX, "") if key.match(ACTIVEJOB_RESERVED_PREFIX_REGEX) [key, filter_context(value)] end def has_global_id? @has_global_id end end end end sentry-sidekiq-5.28.0/lib/sentry-sidekiq.rb0000644000004100000410000000244315070004776020670 0ustar www-datawww-data# frozen_string_literal: true require "sidekiq" require "sentry-ruby" require "sentry/integrable" require "sentry/sidekiq/version" require "sentry/sidekiq/configuration" require "sentry/sidekiq/error_handler" require "sentry/sidekiq/sentry_context_middleware" module Sentry module Sidekiq extend Sentry::Integrable register_integration name: "sidekiq", version: Sentry::Sidekiq::VERSION if defined?(::Rails::Railtie) class Railtie < ::Rails::Railtie config.after_initialize do next unless Sentry.initialized? && defined?(::Sentry::Rails) Sentry.configuration.rails.skippable_job_adapters << "ActiveJob::QueueAdapters::SidekiqAdapter" end end end end end Sidekiq.configure_server do |config| config.error_handlers << Sentry::Sidekiq::ErrorHandler.new config.server_middleware do |chain| chain.add Sentry::Sidekiq::SentryContextServerMiddleware end config.client_middleware do |chain| chain.add Sentry::Sidekiq::SentryContextClientMiddleware end end Sidekiq.configure_client do |config| config.client_middleware do |chain| chain.add Sentry::Sidekiq::SentryContextClientMiddleware end end # patches require "sentry/sidekiq/cron/helpers" require "sentry/sidekiq/cron/job" require "sentry/sidekiq-scheduler/scheduler" sentry-sidekiq-5.28.0/LICENSE.txt0000644000004100000410000000206115070004776016441 0ustar www-datawww-dataThe MIT License (MIT) Copyright (c) 2020 Sentry Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. sentry-sidekiq-5.28.0/.rspec0000644000004100000410000000003715070004776015734 0ustar www-datawww-data--format documentation --color sentry-sidekiq-5.28.0/Rakefile0000644000004100000410000000030615070004776016263 0ustar www-datawww-data# frozen_string_literal: true require "bundler/gem_tasks" require "rspec/core/rake_task" RSpec::Core::RakeTask.new(:spec).tap do |task| task.rspec_opts = "--order rand" end task default: :spec sentry-sidekiq-5.28.0/Gemfile0000644000004100000410000000226715070004776016121 0ustar www-datawww-data# frozen_string_literal: true source "https://rubygems.org" git_source(:github) { |name| "https://github.com/#{name}.git" } eval_gemfile "../Gemfile.dev" # Specify your gem's dependencies in sentry-ruby.gemspec gemspec gem "sentry-ruby", path: "../sentry-ruby" gem "sentry-rails", path: "../sentry-rails" # https://github.com/flavorjones/loofah/pull/267 # loofah changed the required ruby version in a patch so we need to explicitly pin it gem "loofah", "2.20.0" if RUBY_VERSION.to_f < 2.5 if ENV["SIDEKIQ_MAIN"] gem "sidekiq", github: "sidekiq/sidekiq", branch: "main" sidekiq_version = "main" else sidekiq_version = ENV["SIDEKIQ_VERSION"] sidekiq_version = "7.0" if sidekiq_version.nil? sidekiq_version = Gem::Version.new(sidekiq_version) gem "sidekiq", "~> #{sidekiq_version}" end if sidekiq_version == "main" || RUBY_VERSION.to_f >= 2.7 && sidekiq_version >= Gem::Version.new("6.0") gem "sidekiq-cron" if sidekiq_version == "main" || sidekiq_version >= Gem::Version.new("8.0") gem "sidekiq-scheduler", "~> 6.0.0.beta" else gem "sidekiq-scheduler", "~> 5.0.0" end end gem "rails", "> 5.0.0" gem "timecop" gem "vernier", platforms: :ruby if RUBY_VERSION >= "3.2.1" sentry-sidekiq-5.28.0/sentry-sidekiq.gemspec0000644000004100000410000000245015070004776021140 0ustar www-datawww-data# frozen_string_literal: true require_relative "lib/sentry/sidekiq/version" Gem::Specification.new do |spec| spec.name = "sentry-sidekiq" spec.version = Sentry::Sidekiq::VERSION spec.authors = ["Sentry Team"] spec.description = spec.summary = "A gem that provides Sidekiq integration for the Sentry error logger" spec.email = "accounts@sentry.io" spec.license = 'MIT' spec.platform = Gem::Platform::RUBY spec.required_ruby_version = '>= 2.4' spec.extra_rdoc_files = ["README.md", "LICENSE.txt"] spec.files = `git ls-files | grep -Ev '^(spec|benchmarks|examples|\.rubocop\.yml)'`.split("\n") github_root_uri = 'https://github.com/getsentry/sentry-ruby' spec.homepage = "#{github_root_uri}/tree/#{spec.version}/#{spec.name}" spec.metadata = { "homepage_uri" => spec.homepage, "source_code_uri" => spec.homepage, "changelog_uri" => "#{github_root_uri}/blob/#{spec.version}/CHANGELOG.md", "bug_tracker_uri" => "#{github_root_uri}/issues", "documentation_uri" => "http://www.rubydoc.info/gems/#{spec.name}/#{spec.version}" } spec.bindir = "exe" spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] spec.add_dependency "sentry-ruby", "~> 5.28.0" spec.add_dependency "sidekiq", ">= 3.0" end sentry-sidekiq-5.28.0/README.md0000644000004100000410000000306715070004776016104 0ustar www-datawww-data


# sentry-sidekiq, the Sidekiq integration for Sentry's Ruby client --- [![Gem Version](https://img.shields.io/gem/v/sentry-sidekiq.svg)](https://rubygems.org/gems/sentry-sidekiq) ![Build Status](https://github.com/getsentry/sentry-ruby/actions/workflows/sentry_sidekiq_test.yml/badge.svg) [![Coverage Status](https://img.shields.io/codecov/c/github/getsentry/sentry-ruby/master?logo=codecov)](https://codecov.io/gh/getsentry/sentry-ruby/branch/master) [![Gem](https://img.shields.io/gem/dt/sentry-sidekiq.svg)](https://rubygems.org/gems/sentry-sidekiq/) [![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) [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 The official Ruby-language client and integration layer for the [Sentry](https://github.com/getsentry/sentry) error reporting API. ## Getting Started ### Install ```ruby gem "sentry-ruby" gem "sentry-sidekiq" ``` Then you're all set! `sentry-sidekiq` will automatically insert a custom middleware and error handler to capture exceptions from your workers! sentry-sidekiq-5.28.0/CHANGELOG.md0000644000004100000410000000451115070004776016431 0ustar www-datawww-data# Changelog Individual gem's changelog has been deprecated. Please check the [project changelog](https://github.com/getsentry/sentry-ruby/blob/master/CHANGELOG.md). ## 4.4.0 ### Features - Make Sidekiq job context more readable [#1410](https://github.com/getsentry/sentry-ruby/pull/1410) **Before** Sidekiq payload in extra **After** Sidekiq payload in context ## 4.3.0 ### Features - Support performance monitoring on Sidekiq workers [#1311](https://github.com/getsentry/sentry-ruby/pull/1311) ## 4.2.1 - Use ::Rails::Railtie for checking Rails definition [#1284](https://github.com/getsentry/sentry-ruby/pull/1284) - Fixes [#1276](https://github.com/getsentry/sentry-ruby/issues/1276) ## 4.2.0 ### Features - Tag queue name and jid on sidekiq events [#1258](https://github.com/getsentry/sentry-ruby/pull/1258) sidekiq event tagged with queue name and jid ### Refactorings - Add sidekiq adapter to sentry-rails' ignored adapters list [#1257](https://github.com/getsentry/sentry-ruby/pull/1257) ## 4.1.3 - Use sentry-ruby-core as the main SDK dependency [#1245](https://github.com/getsentry/sentry-ruby/pull/1245) ## 4.1.2 - Fix sidekiq middleware [#1175](https://github.com/getsentry/sentry-ruby/pull/1175) - Fixes [#1173](https://github.com/getsentry/sentry-ruby/issues/1173) - Adopt Integrable module [#1177](https://github.com/getsentry/sentry-ruby/pull/1177) ## 4.1.1 - Use stricter dependency declaration [#1159](https://github.com/getsentry/sentry-ruby/pull/1159) ## 4.1.0 - Check SDK initialization before running integrations [#1151](https://github.com/getsentry/sentry-ruby/pull/1151) - Fixes [#1145](https://github.com/getsentry/sentry-ruby/pull/1145) ## 4.0.0 - Only documents update for the official release and no API/feature changes. ## 0.2.0 - Major API changes: [1123](https://github.com/getsentry/sentry-ruby/pull/1123) ## 0.1.3 - Small fixes ## 0.1.2 Fix require reference ## 0.1.1 Release test ## 0.1.0 First version sentry-sidekiq-5.28.0/Makefile0000644000004100000410000000007115070004776016255 0ustar www-datawww-databuild: bundle install gem build sentry-sidekiq.gemspec