karafka / waterdrop

Standalone Karafka library for producing Kafka messages
https://karafka.io
Other
258 stars 39 forks source link

Add topic scope to report_metric #499

Closed YadhuPrakash closed 5 months ago

YadhuPrakash commented 5 months ago

Summary:

Librdkafka emits topic level stats like so:

{
  "name": "rdkafka#producer-1",
  "client_id": "rdkafka",
  "ts": 5016483227792,
  "brokers": {},
  "topics": {
    "test": {
      "topic": "test",
      "batchsize": {},
      "batchcnt": {},
      "partitions": {}
      }
    }
  },
}

This update allows users to subscribe to topic level stats as a metric with: RdKafkaMetric.new(:gauge, :topics, 'topics.batchcnt.avg', %w[batchcnt avg])

Related issue: https://github.com/karafka/waterdrop/issues/495

CLAassistant commented 5 months ago

CLA assistant check
All committers have signed the CLA.