kit icon indicating copy to clipboard operation
kit copied to clipboard

Add a MultiProvider implementation for metrics/multi package

Open medzin opened this issue 8 years ago • 3 comments

Currently there is no implementation of a Provider interface for the metrics/multi package. Adding a MultiProvider that accepts a slice of other Provider implementations would make using multi package more convenient.

medzin avatar Aug 01 '17 12:08 medzin

Metrics are being refactored for the next release; although there is no ETA, this work is probably not worth doing...

peterbourgon avatar Aug 01 '17 12:08 peterbourgon

Will the new version of the metrics package support the use of multiple providers for one metric? It is very convenient to use a combination of expvar and some external metrics storage.

medzin avatar Aug 01 '17 14:08 medzin

Yes. The current version of the metrics package also does this just fine, for the record; just not with the Provider interface.

c := multi.NewCounter(
    prometheus.NewCounter(...),
    expvar.NewCounter(...),
)

peterbourgon avatar Aug 01 '17 14:08 peterbourgon