Sha256: 985a464f261cd198095a3d5d57c32feb859348748cf8b75f669f8c35fffb56b1

Contents?: true

Size: 774 Bytes

Versions: 11

Compression:

Stored size: 774 Bytes

Contents

# frozen_string_literal: true

module Sbmt
  module KafkaConsumer
    module Instrumentation
      class BaseMonitor < Karafka::Instrumentation::Monitor
        # karafka consuming is based around batch-processing
        # so we need these per-message custom events
        SBMT_KAFKA_CONSUMER_EVENTS = %w[
          consumer.consumed_one
          consumer.inbox.consumed_one
          consumer.consumed_batch
          consumer.process_message
          consumer.mark_as_consumed
        ].freeze

        def initialize
          super
          SBMT_KAFKA_CONSUMER_EVENTS.each { |event_id| notifications_bus.register_event(event_id) }
        end

        def instrument(_event_id, _payload = EMPTY_HASH, &block)
          super
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
sbmt-kafka_consumer-3.3.0 lib/sbmt/kafka_consumer/instrumentation/base_monitor.rb
sbmt-kafka_consumer-3.2.2 lib/sbmt/kafka_consumer/instrumentation/base_monitor.rb
sbmt-kafka_consumer-3.2.1 lib/sbmt/kafka_consumer/instrumentation/base_monitor.rb
sbmt-kafka_consumer-3.2.0 lib/sbmt/kafka_consumer/instrumentation/base_monitor.rb
sbmt-kafka_consumer-3.1.0 lib/sbmt/kafka_consumer/instrumentation/base_monitor.rb
sbmt-kafka_consumer-2.8.0 lib/sbmt/kafka_consumer/instrumentation/base_monitor.rb
sbmt-kafka_consumer-3.0.0 lib/sbmt/kafka_consumer/instrumentation/base_monitor.rb
sbmt-kafka_consumer-2.7.1 lib/sbmt/kafka_consumer/instrumentation/base_monitor.rb
sbmt-kafka_consumer-2.7.0 lib/sbmt/kafka_consumer/instrumentation/base_monitor.rb
sbmt-kafka_consumer-2.6.1 lib/sbmt/kafka_consumer/instrumentation/base_monitor.rb
sbmt-kafka_consumer-2.6.0 lib/sbmt/kafka_consumer/instrumentation/base_monitor.rb