Sha256: 825cc71f7b692f6d8d4a9de3c08747e755758aaced08e35213684a59859fa03c

Contents?: true

Size: 700 Bytes

Versions: 5

Compression:

Stored size: 700 Bytes

Contents

require 'honeybadger/plugin'

module Honeybadger
  module Plugins
    Plugin.register :karafka do
      requirement { defined?(::Karafka) && ::Karafka.respond_to?(:monitor) }

      execution do
        require 'honeybadger/karafka'

        if Honeybadger.config[:'exceptions.enabled']
          errors_listener = ::Honeybadger::Karafka::ErrorsListener.new
          ::Karafka.monitor.subscribe(errors_listener)
          ::Karafka.producer.monitor.subscribe(errors_listener) if ::Karafka.respond_to?(:producer)
        end

        if config.load_plugin_insights?(:karafka)
          ::Karafka.monitor.subscribe(::Honeybadger::Karafka::InsightsListener.new)
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
honeybadger-5.26.2 lib/honeybadger/plugins/karafka.rb
honeybadger-5.26.1 lib/honeybadger/plugins/karafka.rb
honeybadger-5.26.0 lib/honeybadger/plugins/karafka.rb
honeybadger-5.25.0 lib/honeybadger/plugins/karafka.rb
honeybadger-5.24.0 lib/honeybadger/plugins/karafka.rb