Skip to content

Karafka Instrumentation Events

This page lists all available instrumentation events for Karafka.

Overview

Karafka uses a notification system that allows you to monitor and hook into various stages of message processing and producer operations. You can subscribe to any of these events to add custom monitoring, logging, or other functionality.

Available Events

Below is the complete list of instrumentation events available in Karafka:

Active_job Events

  • active_job.consume
  • active_job.consumed

App Events

  • app.before_warmup
  • app.initialized
  • app.initializing
  • app.quiet
  • app.quieting
  • app.running
  • app.stopped
  • app.stopping
  • app.supervising
  • app.terminated

Client Events

  • client.events_poll
  • client.pause
  • client.reset
  • client.resume

Connection Events

  • connection.listener.after_fetch_loop
  • connection.listener.before_fetch_loop
  • connection.listener.fetch_loop
  • connection.listener.fetch_loop.received
  • connection.listener.pending
  • connection.listener.quiet
  • connection.listener.quieting
  • connection.listener.running
  • connection.listener.starting
  • connection.listener.stopped
  • connection.listener.stopping

Consumer Events

  • consumer.before_schedule_consume
  • consumer.before_schedule_eofed
  • consumer.before_schedule_idle
  • consumer.before_schedule_revoked
  • consumer.before_schedule_shutdown
  • consumer.before_schedule_tick
  • consumer.consume
  • consumer.consumed
  • consumer.consuming.pause
  • consumer.consuming.retry
  • consumer.consuming.seek
  • consumer.consuming.transaction
  • consumer.eof
  • consumer.eofed
  • consumer.idle
  • consumer.initialize
  • consumer.initialized
  • consumer.revoke
  • consumer.revoked
  • consumer.shutdown
  • consumer.shutting_down
  • consumer.tick
  • consumer.ticked
  • consumer.wrap
  • consumer.wrapped

Dead_letter_queue Events

  • dead_letter_queue.dispatched

Error Events

  • error.occurred

Filtering Events

  • filtering.seek
  • filtering.throttled

Oauthbearer Events

  • oauthbearer.token_refresh

Process Events

  • process.notice_signal

Rebalance Events

  • rebalance.partitions_assign
  • rebalance.partitions_assigned
  • rebalance.partitions_revoke
  • rebalance.partitions_revoked

Statistics Events

  • statistics.emitted

Swarm Events

  • swarm.manager.after_fork
  • swarm.manager.before_fork
  • swarm.manager.control
  • swarm.manager.stopping
  • swarm.manager.terminating
  • swarm.node.after_fork

Worker Events

  • worker.completed
  • worker.process
  • worker.processed

Usage Example

To subscribe to any of these events, you can use the instrumentation monitor:

Karafka::App.monitor.subscribe('event.name') do |event|
  # Your custom logic here
  puts "Event: #{event.id}"
  puts "Payload: #{event.payload}"
end

For more information about using instrumentation, please refer to the main documentation.


Last modified: 2025-11-05 10:02:57