Class: Sbmt::KafkaConsumer::Instrumentation::BaseMonitor

Inherits:
Karafka::Instrumentation::Monitor
  • Object
show all
Defined in:
lib/sbmt/kafka_consumer/instrumentation/base_monitor.rb

Direct Known Subclasses

ChainableMonitor

Constant Summary collapse

SBMT_KAFKA_CONSUMER_EVENTS =

karafka consuming is based around batch-processing so we need these per-message custom events

%w[
  consumer.consumed_one
  consumer.inbox.consumed_one
  consumer.consumed_batch
  consumer.process_message
  consumer.mark_as_consumed
].freeze

Instance Method Summary collapse

Constructor Details

#initializeBaseMonitor

Returns a new instance of BaseMonitor.



17
18
19
20
# File 'lib/sbmt/kafka_consumer/instrumentation/base_monitor.rb', line 17

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

Instance Method Details

#instrument(_event_id, _payload = EMPTY_HASH, &block) ⇒ Object



22
23
24
# File 'lib/sbmt/kafka_consumer/instrumentation/base_monitor.rb', line 22

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