Class: Kafka::Datadog::AsyncProducerSubscriber
- Inherits:
-
StatsdSubscriber
- Object
- ActiveSupport::Subscriber
- StatsdSubscriber
- Kafka::Datadog::AsyncProducerSubscriber
- Defined in:
- lib/kafka/datadog.rb
Instance Method Summary collapse
Instance Method Details
#buffer_overflow(event) ⇒ Object
236 237 238 239 240 241 242 243 |
# File 'lib/kafka/datadog.rb', line 236 def buffer_overflow(event) = { client: event.payload.fetch(:client_id), topic: event.payload.fetch(:topic), } increment("async_producer.produce.errors", tags: ) end |
#enqueue_message(event) ⇒ Object
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 |
# File 'lib/kafka/datadog.rb', line 218 def (event) client = event.payload.fetch(:client_id) topic = event.payload.fetch(:topic) queue_size = event.payload.fetch(:queue_size) max_queue_size = event.payload.fetch(:max_queue_size) queue_fill_ratio = queue_size.to_f / max_queue_size.to_f = { client: client, } # This gets us the avg/max queue size per producer. histogram("async_producer.queue.size", queue_size, tags: ) # This gets us the avg/max queue fill ratio per producer. histogram("async_producer.queue.fill_ratio", queue_fill_ratio, tags: ) end |