client_golang
client_golang copied to clipboard
Rework type structure
Current issues:
- Some interfaces are identical (
UntypedandGauge;HistogramandSummary; all theXxxFuncmetrics), 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. Metriccan 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
GaugeandCountershould just have the methods to manipulate the metrics value in instrumentation.CollectorandMetricshould be separate, and then have aGaugeCollectorto return byNewGaugeand such. - Consider making the various
XxxVecinterfaces so that we can hideMetricVec.
Overall, the number of exported types should be reduced drastically.