From c05a6862053605bd19fed8b181bf129d3945e4d9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 1 Sep 2020 09:52:20 -0400 Subject: [PATCH] internal/controlplane: add telemetry http handler (#1353) (#1355) Co-authored-by: Travis Groth --- internal/controlplane/http.go | 2 ++ internal/controlplane/server.go | 1 + 2 files changed, 3 insertions(+) diff --git a/internal/controlplane/http.go b/internal/controlplane/http.go index 8269f1cc5..cb703b80c 100644 --- a/internal/controlplane/http.go +++ b/internal/controlplane/http.go @@ -11,6 +11,7 @@ import ( "github.com/pomerium/pomerium/internal/httputil" "github.com/pomerium/pomerium/internal/log" "github.com/pomerium/pomerium/internal/middleware" + "github.com/pomerium/pomerium/internal/telemetry" "github.com/pomerium/pomerium/internal/telemetry/requestid" "github.com/pomerium/pomerium/internal/version" ) @@ -35,6 +36,7 @@ func (srv *Server) addHTTPMiddleware() { root.Use(log.UserAgentHandler("user_agent")) root.Use(log.RefererHandler("referer")) root.Use(log.RequestIDHandler("request-id")) + root.Use(telemetry.HTTPStatsHandler(srv.name)) root.Use(middleware.Healthcheck("/ping", version.UserAgent())) root.HandleFunc("/healthz", httputil.HealthCheck) root.HandleFunc("/ping", httputil.HealthCheck) diff --git a/internal/controlplane/server.go b/internal/controlplane/server.go index 8eb1f47eb..b55a98de0 100644 --- a/internal/controlplane/server.go +++ b/internal/controlplane/server.go @@ -44,6 +44,7 @@ type Server struct { currentConfig atomicVersionedOptions configUpdated chan struct{} + name string } // NewServer creates a new Server. Listener ports are chosen by the OS.