server

package
v0.0.0-...-7b8b700 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetricsServer

type MetricsServer struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewMetricsServer

func NewMetricsServer(
	c *appconfig.Config,
	deviceWatchListManager devicewatchlistmanager.Manager,
	registry *registry.Registry,
) (*MetricsServer, func(), error)

func (*MetricsServer) ClearRegistry

func (s *MetricsServer) ClearRegistry() *registry.Registry

ClearRegistry removes the current registry and returns it for cleanup. After calling this, /metrics will return empty responses until SetRegistry is called.

func (*MetricsServer) DumpMetricsToJSON

func (s *MetricsServer) DumpMetricsToJSON() ([]byte, error)

DumpMetricsToJSON is a helper function for debugging that dumps all metrics to JSON

func (*MetricsServer) GetRegistry

func (s *MetricsServer) GetRegistry() *registry.Registry

GetRegistry returns the current registry (atomic read). Returns an empty registry if nil (during hot reload/bind/unbind).

func (*MetricsServer) Health

func (s *MetricsServer) Health(w http.ResponseWriter, _ *http.Request)

func (*MetricsServer) IsReloadInProgress

func (s *MetricsServer) IsReloadInProgress() bool

IsReloadInProgress returns whether a hot reload is in progress

func (*MetricsServer) Metrics

func (s *MetricsServer) Metrics(w http.ResponseWriter, _ *http.Request)

func (*MetricsServer) Run

func (s *MetricsServer) Run(ctx context.Context, stop chan interface{})

func (*MetricsServer) SetRegistry

func (s *MetricsServer) SetRegistry(newRegistry *registry.Registry)

SetRegistry sets the new registry to serve metrics from. /metrics will now serve metrics from the new registry.

func (*MetricsServer) SetReloadInProgress

func (s *MetricsServer) SetReloadInProgress(inProgress bool)

SetReloadInProgress marks whether a hot reload is currently happening This can be exposed via /health endpoint

Jump to

Keyboard shortcuts

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