Versions in this module Expand all Collapse all v0 v0.1.0 Nov 14, 2026 Changes in this version + var DefaultHTTPClient = &http.Client + var ErrDuplicateProbe = errors.New("probe already registered") + func DefaultSkipPaths() map[string]bool + func HealthZHandler() http.Handler + func RecordRoute(next http.Handler) http.Handler + func RoutePattern(r *http.Request) string + func ServiceHealthURL(base string) string + func TrackRoute(next http.Handler) http.Handler + type CheckFunc func(ctx context.Context) error + func HTTPCheck(client *http.Client, url string) CheckFunc + func ServiceCheck(client *http.Client, base string) CheckFunc + func TCPCheck(addr string) CheckFunc + type MemoryState struct + AllocBytes uint64 + HeapBytes uint64 + NumGC uint32 + SysBytes uint64 + type MetricFunc func() any + type Metrics struct + func NewMetrics(o MetricsOptions) *Metrics + func (m *Metrics) Handler() http.Handler + func (m *Metrics) Middleware(skip map[string]bool) func(http.Handler) http.Handler + func (m *Metrics) MustRegister(cs ...prometheus.Collector) + func (m *Metrics) Registry() *prometheus.Registry + func (m *Metrics) StreamOpened(name string) (closed func()) + type MetricsOptions struct + Buckets []float64 + ConstLabels prometheus.Labels + Module string + SkipPaths map[string]bool + type ProbeOption func(*probe) + func Interval(d time.Duration) ProbeOption + func Optional() ProbeOption + func Timeout(d time.Duration) ProbeOption + type ProbeState struct + Consecutive int + DurationMs int64 + Error string + LastRun time.Time + Required bool + Status Status + type Prober struct + func NewProber(instance string, opts ...ProberOption) *Prober + func (p *Prober) AddHTTPProbe(id, url string, opts ...ProbeOption) error + func (p *Prober) AddMetric(id string, fn MetricFunc) + func (p *Prober) AddProbe(id string, check CheckFunc, opts ...ProbeOption) error + func (p *Prober) AddServiceProbe(id, baseURL string, opts ...ProbeOption) error + func (p *Prober) AddTCPProbe(id, addr string, opts ...ProbeOption) error + func (p *Prober) HealthPHandler() http.Handler + func (p *Prober) ReadinessHandler() http.Handler + func (p *Prober) RunOnce(ctx context.Context) + func (p *Prober) Start(ctx context.Context) + func (p *Prober) State() State + func (p *Prober) Status() Status + func (p *Prober) Stop() + type ProberOption func(*Prober) + func WithDefaultInterval(d time.Duration) ProberOption + func WithDefaultTimeout(d time.Duration) ProberOption + func WithVersion(v string) ProberOption + func WithoutScheduling() ProberOption + type State struct + Goroutines int + Instance string + Memory MemoryState + Metrics map[string]any + Probes map[string]ProbeState + StartedAt time.Time + Status Status + UptimeSec int64 + Version string + type Status string + const StatusLoading + const StatusStable + const StatusUnstable