Documentation ¶
Overview ¶
Package prometheus defines a service which is used for metrics collection and health of a node in Harmony.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewService ¶
NewService sets up a new instance for a given address host:port. An empty host will match with any IP so an address like ":19000" is perfectly acceptable.
func PromRegistry ¶
func PromRegistry() *prometheus.Registry
PromRegistry return the registry of prometheus service
Types ¶
type Config ¶
type Config struct { Enabled bool IP string Port int EnablePush bool // enable pushgateway support Gateway string // address of the pushgateway Network string // network type, used as job prefix Legacy bool // legacy or not, legacy is harmony internal node NodeType string // node type, validator or exlorer node Shard uint32 // shard id, used as job suffix Instance string //identifier of the instance in prometheus metrics }
Config is the config for the prometheus service
type Handler ¶
type Handler struct { Path string Handler func(http.ResponseWriter, *http.Request) }
Handler represents a path and handler func to serve on the same port as /metrics, /healthz, /goroutinez, etc.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides Prometheus metrics via the /metrics route. This route will show all the metrics registered with the Prometheus DefaultRegisterer.
Click to show internal directories.
Click to hide internal directories.