Interface for MetricVec (and subclasses)
Having an interface for MetricVec funcs like [Must]CurryWith, With[LabelValues], etc. -- parallel to ObserverVec -- would make it possible to generate mocks and thus facilitate unit testing for CounterVec, GaugeVec, HistogramVec, and SummaryVec.
Possibly related to #223?
Hello 👋 Looks like there was no activity on this issue for the last 3 months. Do you mind updating us on the status? Is this still reproducible or needed? If yes, just comment on this PR or push a commit. Thanks! 🤗 If there will be no activity in the next 4 weeks, this issue will be closed (we can always reopen an issue if we need!).
This would still be lovely to have. Will we survive with out it? For sure. But we would include a lot more unit tests around our metrics code, which we don't do much of today because it's Hard™.
The whole type structure could be improved indeed, but that would require an invasive change, which can only happen with a v2 major release.
In the meantime, you could make use of the fact that Go interfaces don't have to be defined in a particular package. You can define your own MetricVec interface and use it in your code as if they were defined in the client_golang/prometheus package itself.
Closing for now as promised, let us know if you need this to be reopened! 🤗