From 10827cf62eda634a6fd9828cc4e0408aec7a59c8 Mon Sep 17 00:00:00 2001 From: Dominic Evans Date: Thu, 13 May 2021 10:11:32 +0100 Subject: [PATCH] fix: add /metrics handler and stop logging --- internal/rest/server.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/rest/server.go b/internal/rest/server.go index 7a48d79..1a3982a 100644 --- a/internal/rest/server.go +++ b/internal/rest/server.go @@ -2,11 +2,10 @@ package rest import ( "context" - "github.com/gorilla/handlers" + "net/http" + "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/sirupsen/logrus" - "net/http" - "os" ) type Server struct { @@ -17,11 +16,12 @@ func New(bind string) *Server { var s Server r := http.NewServeMux() + r.Handle("/metrics", promhttp.Handler()) r.Handle("/prometheus", promhttp.Handler()) server := http.Server{ Addr: bind, - Handler: handlers.LoggingHandler(os.Stdout, r), + Handler: r, } s.httpSrv = &server