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
279 280 281 282 283 284 285 286 |
# File 'lib/kafka/datadog.rb', line 279 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
288 289 290 291 292 293 294 295 296 |
# File 'lib/kafka/datadog.rb', line 288 def (event) = { client: event.payload.fetch(:client_id), } = event.payload.fetch(:message_count) count("async_producer.dropped_messages", , tags: ) end |
#enqueue_message(event) ⇒ Object
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 |
# File 'lib/kafka/datadog.rb', line 260 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 |