Documentation
¶
Index ¶
- Constants
- func DebugIndexHandler(serviceName, environment, basePath string, enablePprof bool) http.HandlerFunc
- func EnvHandler() http.HandlerFunc
- func HealthHandler(serviceName string) http.HandlerFunc
- func InfoHandler(serviceName, environment string) http.HandlerFunc
- func LivenessHandler(serviceName string) http.HandlerFunc
- func MemoryHandler() http.HandlerFunc
- func PProfIndexHandler(basePath string) http.HandlerFunc
- func ReadinessHandler(serviceName string) http.HandlerFunc
- func RegisterDebugHandlers(mux *http.ServeMux, serviceName, environment string, enablePprof bool)
- func RegisterDebugHandlersWithGateway(mux *gwruntime.ServeMux, serviceName, environment, basePath string, ...)
- func RuntimeHandler() http.HandlerFunc
- func VarsHandler() http.HandlerFunc
- type HealthResponse
- type MemoryStats
- type RuntimeInfo
- type ServiceInfo
Constants ¶
const ( // PProfIndexTemplate is the HTML template for the pprof index page PProfIndexTemplate = `` /* 972-byte string literal not displayed */ // DebugIndexTemplate is the HTML template for the main debug dashboard DebugIndexTemplate = `` /* 12047-byte string literal not displayed */ // PProfSectionTemplate is the HTML template for the pprof section in the debug dashboard PProfSectionTemplate = `` /* 1751-byte string literal not displayed */ )
Variables ¶
This section is empty.
Functions ¶
func DebugIndexHandler ¶
func DebugIndexHandler(serviceName, environment, basePath string, enablePprof bool) http.HandlerFunc
DebugIndexHandler provides a main debug page with links to all debug endpoints
func EnvHandler ¶
func EnvHandler() http.HandlerFunc
EnvHandler provides filtered environment variables
func HealthHandler ¶
func HealthHandler(serviceName string) http.HandlerFunc
HealthHandler handles health check requests
func InfoHandler ¶
func InfoHandler(serviceName, environment string) http.HandlerFunc
InfoHandler provides service information
func LivenessHandler ¶
func LivenessHandler(serviceName string) http.HandlerFunc
LivenessHandler handles liveness probe requests
func PProfIndexHandler ¶
func PProfIndexHandler(basePath string) http.HandlerFunc
PProfIndexHandler provides a custom pprof index page
func ReadinessHandler ¶
func ReadinessHandler(serviceName string) http.HandlerFunc
ReadinessHandler handles readiness probe requests
func RegisterDebugHandlers ¶
RegisterDebugHandlers registers all debug handlers with the given mux
func RegisterDebugHandlersWithGateway ¶
func RegisterDebugHandlersWithGateway(mux *gwruntime.ServeMux, serviceName, environment, basePath string, enablePprof bool)
RegisterDebugHandlersWithGateway registers debug handlers with grpc-gateway ServeMux
func RuntimeHandler ¶
func RuntimeHandler() http.HandlerFunc
RuntimeHandler provides runtime information
func VarsHandler ¶
func VarsHandler() http.HandlerFunc
VarsHandler provides runtime variables in expvar format
Types ¶
type HealthResponse ¶
type HealthResponse struct {
Status string `json:"status"`
Timestamp time.Time `json:"timestamp"`
Service string `json:"service"`
Version string `json:"version,omitempty"`
}
HealthResponse represents the health check response
type MemoryStats ¶
type MemoryStats struct {
Alloc uint64 `json:"alloc"`
TotalAlloc uint64 `json:"total_alloc"`
Sys uint64 `json:"sys"`
NumGC uint32 `json:"num_gc"`
PauseTotalNs uint64 `json:"pause_total_ns"`
}
MemoryStats represents memory statistics
type RuntimeInfo ¶
type RuntimeInfo struct {
GoVersion string `json:"go_version"`
NumGoroutine int `json:"num_goroutine"`
NumCPU int `json:"num_cpu"`
GOMAXPROCS int `json:"gomaxprocs"`
GOOS string `json:"goos"`
GOARCH string `json:"goarch"`
}
RuntimeInfo represents runtime information
type ServiceInfo ¶
type ServiceInfo struct {
ServiceName string `json:"service_name"`
Version string `json:"version"`
BuildTime string `json:"build_time,omitempty"`
GitCommit string `json:"git_commit,omitempty"`
Environment string `json:"environment,omitempty"`
Config map[string]interface{} `json:"config,omitempty"`
}
ServiceInfo represents service information