Documentation
¶
Overview ¶
Package `diagnostics` provides some tools useful for gathering and exposing arbitrary diagnositcs information for external monitoring tools.
Possible usage: integration nodes list into dashboard
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiagnosticsRegistry ¶
type DiagnosticsRegistry struct {
// contains filtered or unexported fields
}
Registry performs all management of diagnostic. Specifically, it allows to registering new diagnostics sources and exposing them through the diagnostics server.
func NewRegistry ¶
func NewRegistry() *DiagnosticsRegistry
NewRegistry creates a new metrics registry.
func (*DiagnosticsRegistry) EnableServer ¶
func (r *DiagnosticsRegistry) EnableServer(port int)
EnableServer enables the diagnostics server on the given port. Data will be exposed on `/diagnostics` path in JSON format.
func (*DiagnosticsRegistry) RegisterSource ¶
func (r *DiagnosticsRegistry) RegisterSource(name string, source func() string)
Registers diagnostics source callback with a given name. Name will be used as a key and callback result as a value in JSON object during composing diagnostics JSON. Note: function will override existing diagnostics source on attempt to register another one with the same name.