Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting metrics from KafkaReceiver #196

Open
gavvvr opened this issue Jun 29, 2024 · 0 comments
Open

Getting metrics from KafkaReceiver #196

gavvvr opened this issue Jun 29, 2024 · 0 comments

Comments

@gavvvr
Copy link

gavvvr commented Jun 29, 2024

Hello

The io.github.nomisRev.kafka.publisher.KafkaPublisher interface in this library exposes metrics() function to get metrics from the underlying org.apache.kafka.clients.producer.KafkaProducer.
Unfortunately, the io.github.nomisRev.kafka.receiver.KafkaReceiver interface does not expose anything similar to obtain metrics.

This is a feature request to make it possible to obtain metrics from the underlying org.apache.kafka.clients.consumer.KafkaConsumer. As for now, I don't even see any workaround to get consumer metrics, because KafkaConsumer gets created on each receive() call and is very well encapsulated.

There are different extensions on org.apache.kafka.clients.consumer.*-types (including raw KafkaConsumer) in Consumer.kt and I could probably refactor current code to use them, but all of them are marked as deprecated with a recommendation to use io.github.nomisRev.kafka.receiver.KafkaReceiver instead.

I guess that receive() method on KafkaReceiver should rather return some advanced combined type, which has both traits: 1) the Flow itself + 2) other interfaces with additional capabilities (for example, for accessing metrics)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant