mirror of
https://github.com/foomo/contentserver.git
synced 2025-10-16 12:25:44 +00:00
22 lines
470 B
Go
22 lines
470 B
Go
package metrics
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
. "github.com/foomo/contentserver/logger"
|
|
"github.com/prometheus/client_golang/prometheus/promhttp"
|
|
"go.uber.org/zap"
|
|
)
|
|
|
|
const metricsRoute = "/metrics"
|
|
|
|
func RunPrometheusHandler(listener string) {
|
|
Log.Info("starting prometheus handler on",
|
|
zap.String("address", listener),
|
|
zap.String("route", metricsRoute),
|
|
)
|
|
Log.Error("prometheus listener failed",
|
|
zap.Error(http.ListenAndServe(listener, promhttp.Handler())),
|
|
)
|
|
}
|