diff --git a/server/http.go b/server/http.go index 1c97ff434939ce4938d1fabb2d32c15185d1d42f..c42f60c81f769c33252d953f2af9fa57fa8c6333 100644 --- a/server/http.go +++ b/server/http.go @@ -18,8 +18,6 @@ import ( "github.com/gorilla/csrf" "github.com/gorilla/mux" "github.com/gorilla/sessions" - "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/client_golang/prometheus/promhttp" "git.autistici.org/id/auth" authclient "git.autistici.org/id/auth/client" @@ -64,8 +62,6 @@ func newAuthSession(ttl time.Duration, username string, userinfo *auth.UserInfo) func init() { gob.Register(&authSession{}) - - prometheus.MustRegister(totalRequests, inFlightRequests) } // Returns the URL of the login handler on the target service. @@ -278,13 +274,11 @@ func (h *Server) Handler() http.Handler { AssetInfo: AssetInfo, Prefix: "static", }))) - m.Handle("/metrics", promhttp.Handler()) m.Handle("/exchange", withDynamicHeaders(http.HandlerFunc(h.handleExchange))) m.Handle("/", withDynamicHeaders(h.withAuth(h.handleHomepage))) - return promhttp.InstrumentHandlerInFlight(inFlightRequests, - promhttp.InstrumentHandlerCounter(totalRequests, m)) + return m } // A relatively strict CSP. @@ -303,23 +297,6 @@ func withDynamicHeaders(h http.Handler) http.Handler { }) } -// Instrumentation. -var ( - totalRequests = prometheus.NewCounterVec( - prometheus.CounterOpts{ - Name: "total_requests", - Help: "Total number of requests.", - }, - []string{"code"}, - ) - inFlightRequests = prometheus.NewGauge( - prometheus.GaugeOpts{ - Name: "inflight_requests", - Help: "Number of in-flight requests.", - }, - ) -) - // Parse the templates that are embedded with the binary (in bindata.go). func parseEmbeddedTemplates() *template.Template { root := template.New("").Funcs(template.FuncMap{