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.consumeactive_job.consumed
App Events¶
app.before_warmupapp.initializedapp.initializingapp.quietapp.quietingapp.runningapp.stoppedapp.stoppingapp.supervisingapp.terminated
Client Events¶
client.events_pollclient.pauseclient.resetclient.resume
Connection Events¶
connection.listener.after_fetch_loopconnection.listener.before_fetch_loopconnection.listener.fetch_loopconnection.listener.fetch_loop.receivedconnection.listener.pendingconnection.listener.quietconnection.listener.quietingconnection.listener.runningconnection.listener.startingconnection.listener.stoppedconnection.listener.stopping
Consumer Events¶
consumer.before_schedule_consumeconsumer.before_schedule_eofedconsumer.before_schedule_idleconsumer.before_schedule_revokedconsumer.before_schedule_shutdownconsumer.before_schedule_tickconsumer.consumeconsumer.consumedconsumer.consuming.pauseconsumer.consuming.retryconsumer.consuming.seekconsumer.consuming.transactionconsumer.eofconsumer.eofedconsumer.idleconsumer.initializeconsumer.initializedconsumer.revokeconsumer.revokedconsumer.shutdownconsumer.shutting_downconsumer.tickconsumer.tickedconsumer.wrapconsumer.wrapped
Dead_letter_queue Events¶
dead_letter_queue.dispatched
Error Events¶
error.occurred
Filtering Events¶
filtering.seekfiltering.throttled
Oauthbearer Events¶
oauthbearer.token_refresh
Process Events¶
process.notice_signal
Rebalance Events¶
rebalance.partitions_assignrebalance.partitions_assignedrebalance.partitions_revokerebalance.partitions_revoked
Statistics Events¶
statistics.emitted
Swarm Events¶
swarm.manager.after_forkswarm.manager.before_forkswarm.manager.controlswarm.manager.stoppingswarm.manager.terminatingswarm.node.after_fork
Worker Events¶
worker.completedworker.processworker.processedworker.scaling.downworker.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