zio/zio-zmx

Metrics API: MetricsDataModel is package private, not compatible with API

Closed this issue · 4 comments

hdpz commented

On zio-zmx 0.0.5.

This concerns the function of the metrics package:
ZMX.observe(name: String, v: Double, ht: HistogramType, tags: (String, String)*): ZIO[Any, Nothing, Unit]

A histogram type is expected in input, however this type is contained within the package private object MetricsDataModel, which makes calling this function impossible from outside the package (unless there is another way to create a HistogramType that I did not find ?).

I'll take a look at this later today - There was a working example for a histogram - need to check if that is still valid.

hdpz commented

Thanks, the example I found was in InstrumentedSample.scala. However it will not encounter the same bug since the example code is part of the zmx package and has therefore access to the package private MetricsDataModel.HistogramType.

Happy to help if necessary

@huggsy - thats right of course. This having said, the HistgramType needs to be public API. If you are at it now, you may want to raise a PR. Otherwise tomorrow I will be at my desk and can do it.

hdpz commented

Opened a PR concerning this (210), happy to discuss