neoneo-go/pkg/network/metrics/prometheus.go
Vsevolod Brekelov 0085831ec5 network: add Pprof metrics
Since we have some perf issues from time to time it is good to have pprof debugger. Disabled by default.
2019-12-17 14:13:07 +03:00

20 lines
468 B
Go

package metrics
import (
"net/http"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
// PrometheusService https://prometheus.io/docs/guides/go-application.
type PrometheusService Service
// NewPrometheusService creates new service for gathering prometheus metrics.
func NewPrometheusService(cfg Config) *Service {
return &Service{
&http.Server{
Addr: cfg.Address + ":" + cfg.Port,
Handler: promhttp.Handler(),
}, cfg, "Prometheus",
}
}