feat: add prometheus metrics (#342)

This commit is contained in:
Slawomir CALUCH
2024-11-09 18:43:51 +00:00
committed by GitHub
parent da378b9154
commit 2624e25c94
6 changed files with 106 additions and 21 deletions
+3
View File
@@ -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")