feat: add prometheus metrics (#342)
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"net/http"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
@@ -15,6 +16,8 @@ func StartApiServer(apiBinding string) {
|
||||
|
||||
apiRoutes.Path("/vars").Handler(expvar.Handler())
|
||||
|
||||
apiRoutes.Path("/metrics").Handler(promhttp.Handler())
|
||||
|
||||
go func() {
|
||||
logrus.WithError(
|
||||
http.ListenAndServe(apiBinding, apiRoutes)).Error("API server failed")
|
||||
|
||||
Reference in New Issue
Block a user