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

- old
+ new

@@ -215,9 +215,22 @@ if event.payload.key?(:exception) increment("consumer.leave_group.errors", tags: tags) end end + def pause_status(event) + tags = { + client: event.payload.fetch(:client_id), + group_id: event.payload.fetch(:group_id), + topic: event.payload.fetch(:topic), + partition: event.payload.fetch(:partition), + } + + duration = event.payload.fetch(:duration) + + gauge("consumer.pause.duration", duration, tags: tags) + end + attach_to "consumer.kafka" end class ProducerSubscriber < StatsdSubscriber def produce_message(event)