plugins/metrics v0.1.0
·
8 commits
to main
since this release
Prometheus metrics plugin (#35).
Turns @Counter / @Gauge(name=, help=, namespace=, labels=[…]) annotations into a generated file of registered Prometheus collectors: a var per metric, RegisterMetrics(reg), and a typed accessor per metric. For custom/business metrics; complements the automatic per-call @Timed.
Add to goboot.yaml:
plugins:
- github.com/zombocoder/goboot/plugins/metrics@v0.1.0
then generated.RegisterMetrics(reg) and expose /metrics via promhttp. Requires core v0.1.5 and github.com/prometheus/client_golang in the target module.