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
383 384 385 386 387 388 389 390 |
# File 'lib/kafka/datadog.rb', line 383 def buffer_overflow(event) = { client: event.payload.fetch(:client_id), topic: event.payload.fetch(:topic), } increment("async_producer.produce.errors", tags: ) end |
#drop_messages(event) ⇒ Object
392 393 394 395 396 397 398 399 400 |
# File 'lib/kafka/datadog.rb', line 392 def (event) = { client: event.payload.fetch(:client_id), } = event.payload.fetch(:message_count) count("async_producer.dropped_messages", , tags: ) end |
#enqueue_message(event) ⇒ Object
364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 |
# File 'lib/kafka/datadog.rb', line 364 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, topic: topic, } # 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 |