Sha256: 6b0e1f56686e3f2d39ab6dd4b03f3566be678c41e8ae39cc51542a3d5892f804

Contents?: true

Size: 807 Bytes

Versions: 8

Compression:

Stored size: 807 Bytes

Contents

# frozen_string_literal: true

module Appsignal
  class Hooks
    class SidekiqHook < Appsignal::Hooks::Hook
      register :sidekiq

      def dependencies_present?
        defined?(::Sidekiq)
      end

      def install
        require "appsignal/integrations/sidekiq"
        Appsignal::Probes.register :sidekiq, Appsignal::Probes::SidekiqProbe

        ::Sidekiq.configure_server do |config|
          config.error_handlers <<
            Appsignal::Integrations::SidekiqErrorHandler.new

          config.server_middleware do |chain|
            if chain.respond_to? :prepend
              chain.prepend Appsignal::Integrations::SidekiqMiddleware
            else
              chain.add Appsignal::Integrations::SidekiqMiddleware
            end
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
appsignal-3.8.1-java lib/appsignal/hooks/sidekiq.rb
appsignal-3.8.1 lib/appsignal/hooks/sidekiq.rb
appsignal-3.8.0-java lib/appsignal/hooks/sidekiq.rb
appsignal-3.8.0 lib/appsignal/hooks/sidekiq.rb
appsignal-3.7.6-java lib/appsignal/hooks/sidekiq.rb
appsignal-3.7.6 lib/appsignal/hooks/sidekiq.rb
appsignal-3.7.2-java lib/appsignal/hooks/sidekiq.rb
appsignal-3.7.2 lib/appsignal/hooks/sidekiq.rb