Documentation
¶
Index ¶
- type MetricsServer
- func (s *MetricsServer) ClearRegistry() *registry.Registry
- func (s *MetricsServer) DumpMetricsToJSON() ([]byte, error)
- func (s *MetricsServer) GetRegistry() *registry.Registry
- func (s *MetricsServer) Health(w http.ResponseWriter, _ *http.Request)
- func (s *MetricsServer) IsReloadInProgress() bool
- func (s *MetricsServer) Metrics(w http.ResponseWriter, _ *http.Request)
- func (s *MetricsServer) Run(ctx context.Context, stop chan interface{})
- func (s *MetricsServer) SetRegistry(newRegistry *registry.Registry)
- func (s *MetricsServer) SetReloadInProgress(inProgress bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MetricsServer ¶
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