lib/kafka/datadog.rb in ruby-kafka-0.6.0.beta2 vs lib/kafka/datadog.rb in ruby-kafka-0.6.0.beta3

- old
+ new

@@ -347,7 +347,22 @@ count("async_producer.dropped_messages", message_count, tags: tags) end attach_to "async_producer.kafka" end + + class FetcherSubscriber < StatsdSubscriber + def loop(event) + queue_size = event.payload.fetch(:queue_size) + + tags = { + client: event.payload.fetch(:client_id), + group_id: event.payload.fetch(:group_id), + } + + gauge("fetcher.queue_size", queue_size, tags: tags) + end + + attach_to "fetcher.kafka" + end end end