Class: Karafka::Instrumentation::Notifications

Inherits:
Core::Monitoring::Notifications
  • Object
show all
Defined in:
lib/karafka/instrumentation/notifications.rb

Overview

Note:

This class acts as a singleton because we are only permitted to have single monitor per running process (just as logger)

Monitor is used to hookup external monitoring services to monitor how Karafka works It provides a standardized API for checking incoming messages/enqueueing etc Since it is a pub-sub based on dry-monitor, you can use as many subscribers/loggers at the same time, which means that you might have for example file logging and NewRelic at the same time

Constant Summary collapse

EVENTS =
Note:

The non-error once support timestamp benchmarking

Note:

Depending on Karafka extensions and additional engines, this might not be the complete list of all the events. Please use the #available_events on fully loaded Karafka system to determine all of the events you can use.

List of events that we support in the system and to which a monitor client can hook up

%w[
  active_job.consume
  active_job.consumed

  app.initialized
  app.running
  app.quieting
  app.quiet
  app.stopping
  app.stopped
  app.terminated

  client.pause
  client.resume

  connection.listener.before_fetch_loop
  connection.listener.fetch_loop
  connection.listener.fetch_loop.received

  connection.client.rebalance_callback
  connection.client.poll.error
  connection.client.unsubscribe.error

  consumer.consume
  consumer.consumed
  consumer.consuming.pause
  consumer.consuming.retry
  consumer.idle
  consumer.revoke
  consumer.revoked
  consumer.shutting_down
  consumer.shutdown

  dead_letter_queue.dispatched

  filtering.throttled
  filtering.seek

  process.notice_signal

  statistics.emitted

  worker.process
  worker.processed
  worker.completed

  error.occurred
].freeze

Instance Method Summary collapse

Constructor Details

#initializeKarafka::Instrumentation::Monitor

Returns monitor instance for system instrumentation.



69
70
71
72
# File 'lib/karafka/instrumentation/notifications.rb', line 69

def initialize
  super
  EVENTS.each { |event| register_event(event) }
end