-
Notifications
You must be signed in to change notification settings - Fork 144
Open
Labels
good first issueGood for newcomersGood for newcomers
Description
PR #1143 introduces the new trait ConsumerMetrics. We see opportunity to increase the number of metric use cases by allowing users to plug in their own implementations.
These use cases come to mind:
- Change the histogram boundaries. This could be supported by allowing users to override the histogram boundaries in the current implementation,
ZioConsumerMetrics(the boundaries are declared asprotectedso overriding is already possible). - Use of a completely different metrics backend, e.g. Dropwizard metrics or Micrometer. This could be supported by allowing users to provide their own implementation of
ConsumerMetrics.
One problem that needs to be solved is that trait ConsumerMetrics uses the completely internal type Runloop.State. The type Runloop.State has moved around and changed many times in zio-kafka's history. Something that is possible because it is an internal private type. Exposing Runloop.State is therefore not attractive.
A possible solution:
- Move the trait
ConsumerMetricsto thezio.kafka.consumer.metricspackage. - In the trait, replace the parameter of type
Runloop.Statewith something that does not expose internal types. - Allow users to provide their own implementation via
ConsumerSettings.
Considerations
- It is not yet established whether any user needs the flexibility proposed in this issue.
- Other parts of zio-kafka (producer api, admin api) do not collect metrics yet. Any solution has to be scalable to those parts as well.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers