-
Notifications
You must be signed in to change notification settings - Fork 3
feat: add metrics for sinks #62
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: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #62 +/- ##
============================================
- Coverage 77.62% 76.20% -1.43%
Complexity 351 351
============================================
Files 21 22 +1
Lines 1426 1437 +11
Branches 141 143 +2
============================================
- Hits 1107 1095 -12
- Misses 232 255 +23
Partials 87 87 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 metrics for sinks by introducing a new SinkMetricsReporter class and refactors existing classes to use record declarations for improved code structure.
- Creates a new
SinkMetricsReporterclass for monitoring sink performance - Converts five classes from traditional class declarations to record declarations
- Integrates the new sink metrics reporter into the main application
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
SinkMetricsReporter.java |
New comprehensive metrics reporter for sinks with flexible composition patterns |
JsonConsoleSink.java |
Converted from class to record declaration |
AvroConsoleSink.java |
Converted from class to record declaration |
ProcessorMetricsReporter.java |
Converted from class to record declaration |
ConsumerMetricsReporter.java |
Converted from class to record declaration |
RebalanceListener.java |
Converted from class to record declaration |
App.java |
Integrated new sink metrics reporter into the application |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| */ | ||
| public class JsonConsoleSink<K, V> implements MessageSink<K, V> { | ||
|
|
||
| public record JsonConsoleSink<K, V>(Logger logger, Level logLevel) implements MessageSink<K, V> { |
Copilot
AI
Sep 9, 2025
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.
The record's constructor parameters use Logger and Level without the fully qualified System.Logger and System.Logger.Level types that were used in the original constructor. This creates an ambiguity since multiple Logger and Level types exist in the Java ecosystem.
| public record JsonConsoleSink<K, V>(Logger logger, Level logLevel) implements MessageSink<K, V> { | |
| public record JsonConsoleSink<K, V>(java.lang.System.Logger logger, java.lang.System.Logger.Level logLevel) implements MessageSink<K, V> { |
| */ | ||
| public class AvroConsoleSink<K, V> implements MessageSink<K, V> { | ||
|
|
||
| public record AvroConsoleSink<K, V>(Logger logger, Level logLevel) implements MessageSink<K, V> { |
Copilot
AI
Sep 9, 2025
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.
The record's constructor parameters use Logger and Level without the fully qualified System.Logger and System.Logger.Level types that were used in the original constructor. This creates an ambiguity since multiple Logger and Level types exist in the Java ecosystem.
| public record AvroConsoleSink<K, V>(Logger logger, Level logLevel) implements MessageSink<K, V> { | |
| public record AvroConsoleSink<K, V>(java.lang.System.Logger logger, java.lang.System.Logger.Level logLevel) implements MessageSink<K, V> { |
| /** | ||
| * Creates a processor metrics reporter with the specified registry and default logging. | ||
| * |
Copilot
AI
Sep 9, 2025
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.
The constructor documentation references parameters that no longer exist in the record declaration. The record constructor now has different parameters (processorNamesSupplier, metricsFetcher, reporter) than what the documentation describes.
| /** | ||
| * Creates a consumer metrics reporter with the specified metrics supplier and reporter. | ||
| * |
Copilot
AI
Sep 9, 2025
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.
The constructor documentation references parameters that no longer exist in the record declaration. The record constructor now has different parameters (metricsSupplier, uptimeSupplier, reporter) than what the documentation describes.
No description provided.