Posts Of The Week 2021-04-01
I spent a couple of hours evaluating 3rd party libraries. What have I learned? For me, there’s one clear winner in a small field of candidates.
Presently, these are the top hits for “golang gauge counter timer”.
- https://pkg.go.dev/github.com/go-kit/kit/metrics
- https://pkg.go.dev/github.com/facebookgo/metrics
- https://github.com/uber-go/tally
The first result is go-kit. Go-kit isn’t a metrics library. Rather, it bills itself as a “framework for building microservices.” Its metrics package is simply a set of interfaces. You then refrence one of the many sub-packages with concrete implementations. As a consequence, it’s go.mod file is pretty huge.
Facebook’s metrics library has been archived. So scratch that.
Uber’s Tally looks reasonable and appears to receive timely updates. Tally throws a lot of concepts at you (such as Scope and Reporter) with little documentation. Curiously, it still does not use go modules for dependency management.
There’s also a port of the famous Coda Hale’s metric library called go-metrics. Unlike Tally, project activity has dwindled over time.
While both Tally and go-metrics have Prometheus integration, the go-metrics version only supports the Summary data type rather than true “Histogram”. Tally supports both Summary and Histogram.
Right now Tally seems like the best choice if you want a generic Metrics API. That’s all folks!