diagnostics

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: MIT Imports: 6 Imported by: 1

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 Registry added in v1.5.0

type Registry 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() *Registry

NewRegistry creates a new metrics registry.

func (*Registry) EnableServer added in v1.5.0

func (r *Registry) EnableServer(port int)

EnableServer enables the diagnostics server on the given port. Data will be exposed on `/diagnostics` path in JSON format.

func (*Registry) RegisterSource added in v1.5.0

func (r *Registry) RegisterSource(name string, source func() string)

RegisterSource 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.

Jump to

Keyboard shortcuts

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