Documentation ¶
Overview ¶
Package prometheus defines a service which is used for metrics collection and health of a node in Prysm.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunSimpleServerOrDie ¶
func RunSimpleServerOrDie(addr string)
RunSimpleServerOrDie is a blocking call to serve /metrics at the given address.
Types ¶
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 LogrusCollector ¶
type LogrusCollector struct {
// contains filtered or unexported fields
}
LogrusCollector is a logrus hook to collect log counters.
func NewLogrusCollector ¶
func NewLogrusCollector() *LogrusCollector
NewLogrusCollector register internal metrics and return an logrus hook to collect log counters This function can be called only once, if more than one call is made an error will be returned.
func (*LogrusCollector) Fire ¶
func (hook *LogrusCollector) Fire(entry *logrus.Entry) error
Fire is called on every log call.
func (*LogrusCollector) Levels ¶
func (_ *LogrusCollector) Levels() []logrus.Level
Levels return a slice of levels supported by this hook;
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.
func NewService ¶
func NewService(addr string, svcRegistry *runtime.ServiceRegistry, additionalHandlers ...Handler) *Service
NewService sets up a new instance for a given address host:port. An empty host will match with any IP so an address like ":2121" is perfectly acceptable.