haskell-works / hw-kafka-client

Kafka client for Haskell, including auto-rebalancing consumers
MIT License
139 stars 50 forks source link

Add statistics JSON parsing feature #157

Open phile314 opened 3 years ago

phile314 commented 3 years ago

Currently the API exposes the statistics callback from rdkafka and provides the full JSON string. As far as I could see, there is no function to parse this into a structured representation. It would be nice to have e.g. an aeson parser for the statistics json.

I am going to implement one for myself anyway to monitor consumer lag, but I was wondering if you would be interested in a PR? Personally I am a bit torn if it should be added to this library. It feels like crucial functionality for using Kafka in production, on the other hand aeson is not a terribly light-weight dependency....