client_golang icon indicating copy to clipboard operation
client_golang copied to clipboard

Rework type structure

Open beorn7 opened this issue 9 years ago • 0 comments

Current issues:

  • Some interfaces are identical (Untyped and Gauge; Histogram and Summary; all the XxxFunc metrics), they are the same for Go (you could assign a Histogram to a Summary variable). The number of interfaces can be reduced a lot here.
  • Metric can be way less exposed as it is essentially only used internally by the registry. It's probably used by normal using mostly for testing, but it is planned to provide some test tools to make that unnecessary.
  • Interfaces like Gauge and Counter should just have the methods to manipulate the metrics value in instrumentation. Collector and Metric should be separate, and then have a GaugeCollector to return by NewGauge and such.
  • Consider making the various XxxVec interfaces so that we can hide MetricVec.

Overall, the number of exported types should be reduced drastically.

beorn7 avatar Aug 16 '16 16:08 beorn7