debug

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2025 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
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 = `` /* 11985-byte string literal not displayed */

	// PProfSectionTemplate is the HTML template for the pprof section in the debug dashboard
	PProfSectionTemplate = `` /* 1741-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 MemoryHandler

func MemoryHandler() http.HandlerFunc

MemoryHandler provides memory statistics

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

func RegisterDebugHandlers(mux *http.ServeMux, serviceName, environment string, enablePprof bool)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL