zio/zio-zmx

Make actual Metric interfaces private

Closed this issue · 2 comments

This is to make the interfaces Counter , Gauge, Histogram, Summary and Set private as we do not want the user to extend those nor do we want the user to directly use them. This will enforce the usage of aspects.

At the same time we may want to revisit MetrikcKey and MetricListener and decide whether these should be in the public API (move them from internal to somewhere else) or make them private as well.

Another approach we could take here is to seal the metric interfaces. Clearly they are not meant to be extended and working with aspects is the most idiomatic way to use metrics. But as long as the apply method on the concrete metrics is used to construct them they have exactly the same safety properties as the metric aspects.

This has been obviated by the move of the metrics interface into ZIO core.