pgweb/pkg/metrics/server.go
Dan Sosedoff 08bbb1537e
Implement process uptime metric (#666)
* Implement process uptime metric
* Add clarification comment
* Add another clarification comment
2023-03-30 12:51:49 -05:00

15 lines
320 B
Go

package metrics
import (
"net/http"
"github.com/sirupsen/logrus"
)
func StartServer(logger *logrus.Logger, path string, addr string) error {
logger.WithField("addr", addr).WithField("path", path).Info("starting prometheus metrics server")
http.Handle(path, NewHandler())
return http.ListenAndServe(addr, nil)
}