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 a list of the instrumentation events available in Karafka. Depending on which Karafka extensions and additional engines you use, this might not be the complete list of all the events: some events are registered dynamically at runtime. Use #available_events on a fully loaded Karafka system to determine all the events you can use.

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
  • worker.scaling.down
  • worker.scaling.up

Usage Example

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

Karafka.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: 2026-08-12 18:42:23