[PHASE-9] Expose runtime go metrics

This commit is contained in:
Savely Krendelhoff 2025-08-23 18:04:18 +07:00
parent 64513deaf8
commit 2d8a7fae61
No known key found for this signature in database
GPG key ID: F70DFD34F40238DE

View file

@ -18,6 +18,8 @@ import (
"hash-of-wisdom/internal/service"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/prometheus/client_golang/prometheus/collectors"
"github.com/prometheus/client_golang/prometheus"
_ "net/http/pprof"
)
@ -64,6 +66,10 @@ func main() {
},
}
// Register Go runtime metrics
prometheus.MustRegister(collectors.NewGoCollector())
prometheus.MustRegister(collectors.NewProcessCollector(collectors.ProcessCollectorOpts{}))
// Start metrics and pprof HTTP server
go func() {
http.Handle("/metrics", promhttp.Handler())