any way to get the librdkafka statistics from a promisified api?
stats_cb does not seem to be supported. Is there a particular reason for this or just simple matter of coding?
Other than implementing that is there any other way to get the statistics? I'm mostly interested in queue sizes, transmitted messages and errors per topic. KIP-714 which I think can be configured for librdkafka, on a quick read, does not seem to include these, but maybe I'm mistaken. Having locally exported metrics would also allow adding custom/pod specific labels to the metrics
I had a little lookaround and it seems that we can add a stats_cb configuration option and hook that to event.stats event emitted by .internalClient. Would not have to touch the librdkafka bindings even.
Would that be an acceptable way to support this use case.
@sakari I would argue that it's a critical part that's missing. about your listed findings - if I understand correctly, that's a code modification to this library, correct? I'm looking for an immediate workaround
We are migrating from KafkaJs and facing the same issue, we have some events and hooks to get metrics from KafkaJs library, but can't use stats_cb of librdkafka in this library.
After code review, this callback glue with the Js world is coded in the C++ part of the client library. in src/config.cc
Is this feature on the roadmap?
I will check how project node-librdkafka address this issue.
similarly trying to use promisified API similar to KafkaJs instrumentation events:
consumer.on(EVENT, callback)
but this doesn't appear to be supported at the time being