gonic icon indicating copy to clipboard operation
gonic copied to clipboard

support for prometheus-style metrics

Open jelmer opened this issue 2 years ago • 2 comments

It would be great if gonic supported prometheus-style metrics at /metrics. Happy to contribute something if you'd be open to accepting PRs that added support for that.

jelmer avatar Jul 24 '21 11:07 jelmer

Yeah cool idea. Would the output of using expvar be suitable?

https://pkg.go.dev/expvar

This would be then /debug/vars instead of /metrics

sentriz avatar Jul 24 '21 19:07 sentriz

On Sat, Jul 24, 2021 at 12:02:18PM -0700, Senan Kelly wrote:

Yeah cool idea. Would the output of using expvar be suitable?

https://pkg.go.dev/expvar

This would be then /debug/vars instead of /metrics

Unfortunately that wouldn't be scrapable by prometheus directly; if you'd prefer not to have prometheus support directly in gonic, I could use /debug/vars that to build a sidecar that exposes metrics appropriate for prometheus.

Jelmer

-- Jelmer Vernooij @.***> PGP Key: https://www.jelmer.uk/D729A457.asc

jelmer avatar Jul 27 '21 06:07 jelmer