Commit Graph

9 Commits

Author SHA1 Message Date
Tom Wilkie 9c8ba1f945 Review feedback: add comment and tests for WrapRegistererWith.
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
2020-06-04 11:51:51 +01:00
Tom Wilkie 614377c550 Review feedback: use one line.
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
2020-06-04 10:57:40 +01:00
Tom Wilkie 8961609f91 Ensure that nil registers are treat as a no-op, even when wrapping.
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
2020-06-04 10:30:51 +01:00
beorn7 3ba240a80f Improve doc comments in promauto
In particular, point out that `With(nil)` is valid.

Signed-off-by: beorn7 <beorn@grafana.com>
2020-06-03 13:56:49 +02:00
Michael Cristina be019d1f24 Fix typo in godoc help text
Signed-off-by: Michael Cristina <mcristina444@gmail.com>
2020-05-02 10:44:25 -05:00
beorn7 1c2884b807 Add NewUntypedFunc to promauto
This constructor was simply forgotten.

Signed-off-by: beorn7 <beorn@grafana.com>
2020-02-13 22:08:18 +01:00
beorn7 92c1ac77e7 Add a "factory" to make promauto work for custom registries
Also, update the package documentation. The concerns about the global
registry aren't really valid anymore because promauto now also works
with custom registries.

The musings about the http.DefaultMux are more a digression and
shouldn't be in a doc comment.

Signed-off-by: beorn7 <beorn@grafana.com>
2020-02-13 22:03:30 +01:00
Adam Thomason 660e6909cc promauto: add NewCounterFunc and NewGaugeFunc 2018-03-17 14:01:36 -07:00
beorn7 b82bcfe55f Add a package promauto that provides auto-registering metrics
Finally, I found an easy solution to provide the "evil"
auto-registration without getting death threats from the wardens of Go
purity. The reasoning can be found in the package's doc comment.
2018-02-16 12:55:57 +01:00