-
Notifications
You must be signed in to change notification settings - Fork 1
Add prometheus metric reporting for ruby-kafka #15
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
base: v0.6-catawiki
Are you sure you want to change the base?
Conversation
b7d42a6
to
d3fbea9
Compare
d3fbea9
to
4a30e94
Compare
e30bb49
to
ef07ea9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds Prometheus metric reporting support for the ruby-kafka library by implementing a comprehensive monitoring system. The implementation includes metrics tracking for various Kafka operations including producer, consumer, and connection activities.
- Implements Prometheus metrics collection for Kafka operations using ActiveSupport subscribers
- Adds comprehensive test coverage for all monitored Kafka events and metrics
- Extends consumer batch processing to include last message create time for time lag calculations
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
File | Description |
---|---|
lib/kafka/prometheus.rb | Core implementation of Prometheus metrics collection with subscriber classes for different Kafka components |
spec/prometheus_spec.rb | Comprehensive test suite covering all Prometheus metrics and event scenarios |
lib/kafka/consumer.rb | Minor enhancement to include last message create time in batch processing payload |
Gemfile | Adds prometheus-client gem dependency for development/test environments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, nice one!
Is there an easy way to generate some metrics in staging to make sure that it works as expected?
why are you only adding metrics to the consumer? |
I would have to create a pre-release gem which isn't the easiest for this gem. Since this is an opt-in feature I am not sure if it would break anything. LMK if I am missing anything |
Um metrics are for both producers and consumers. The consumer was missing a data point so I added that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but I strongly recommend manually publishing a pre-release version and testing this before merging this.
You can just use gem release
and use semver to mark it as -alpha
and it should work fine. I've done this in the past - here's some reference docs. You need a PAT with the proper permissions.
copied as is from upstream https://github.com/zendesk/ruby-kafka