mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-03 04:16:03 +02:00
internal/controlplane: add telemetry http handler (#1353)
This commit is contained in:
parent
8ab0dcb45b
commit
2e714c211e
2 changed files with 3 additions and 0 deletions
|
@ -11,6 +11,7 @@ import (
|
||||||
"github.com/pomerium/pomerium/internal/httputil"
|
"github.com/pomerium/pomerium/internal/httputil"
|
||||||
"github.com/pomerium/pomerium/internal/log"
|
"github.com/pomerium/pomerium/internal/log"
|
||||||
"github.com/pomerium/pomerium/internal/middleware"
|
"github.com/pomerium/pomerium/internal/middleware"
|
||||||
|
"github.com/pomerium/pomerium/internal/telemetry"
|
||||||
"github.com/pomerium/pomerium/internal/telemetry/requestid"
|
"github.com/pomerium/pomerium/internal/telemetry/requestid"
|
||||||
"github.com/pomerium/pomerium/internal/version"
|
"github.com/pomerium/pomerium/internal/version"
|
||||||
)
|
)
|
||||||
|
@ -35,6 +36,7 @@ func (srv *Server) addHTTPMiddleware() {
|
||||||
root.Use(log.UserAgentHandler("user_agent"))
|
root.Use(log.UserAgentHandler("user_agent"))
|
||||||
root.Use(log.RefererHandler("referer"))
|
root.Use(log.RefererHandler("referer"))
|
||||||
root.Use(log.RequestIDHandler("request-id"))
|
root.Use(log.RequestIDHandler("request-id"))
|
||||||
|
root.Use(telemetry.HTTPStatsHandler(srv.name))
|
||||||
root.Use(middleware.Healthcheck("/ping", version.UserAgent()))
|
root.Use(middleware.Healthcheck("/ping", version.UserAgent()))
|
||||||
root.HandleFunc("/healthz", httputil.HealthCheck)
|
root.HandleFunc("/healthz", httputil.HealthCheck)
|
||||||
root.HandleFunc("/ping", httputil.HealthCheck)
|
root.HandleFunc("/ping", httputil.HealthCheck)
|
||||||
|
|
|
@ -44,6 +44,7 @@ type Server struct {
|
||||||
|
|
||||||
currentConfig atomicVersionedOptions
|
currentConfig atomicVersionedOptions
|
||||||
configUpdated chan struct{}
|
configUpdated chan struct{}
|
||||||
|
name string
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewServer creates a new Server. Listener ports are chosen by the OS.
|
// NewServer creates a new Server. Listener ports are chosen by the OS.
|
||||||
|
|
Loading…
Add table
Reference in a new issue