observability

package
v17.5.2 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModuleName = "observability"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MetricServer

type MetricServer struct {
	Log *slog.Logger
	API modshared.API
	// Name is the name of the application.
	Name                  string
	Listener              net.Listener
	PrometheusURLPath     string
	LivenessProbeURLPath  string
	ReadinessProbeURLPath string
	Gatherer              prometheus.Gatherer
	Registerer            prometheus.Registerer
	ProbeRegistry         *ProbeRegistry
}

func (*MetricServer) ConstructHandler

func (s *MetricServer) ConstructHandler() http.Handler

func (*MetricServer) Run

func (s *MetricServer) Run(ctx context.Context) error

type Probe

type Probe func(context.Context) error

Probe is the expected type for probe functions

type ProbeRegistry

type ProbeRegistry struct {
	// contains filtered or unexported fields
}

func NewProbeRegistry

func NewProbeRegistry() *ProbeRegistry

func (*ProbeRegistry) Liveness

func (p *ProbeRegistry) Liveness(ctx context.Context) error

func (*ProbeRegistry) Readiness

func (p *ProbeRegistry) Readiness(ctx context.Context) error

func (*ProbeRegistry) RegisterLivenessProbe

func (p *ProbeRegistry) RegisterLivenessProbe(key string, probe Probe)

func (*ProbeRegistry) RegisterReadinessProbe

func (p *ProbeRegistry) RegisterReadinessProbe(key string, probe Probe)

func (*ProbeRegistry) RegisterReadinessToggle

func (p *ProbeRegistry) RegisterReadinessToggle(key string) func()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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