Documentation ¶
Overview ¶
Helper library to register prometheus metrics for logrus errors. Inspired by Matthias Friedrich's blog post: https://blog.mafr.de/2019/03/03/monitoring-log-statements-in-go/
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PrometheusHook ¶
type PrometheusHook struct {
// contains filtered or unexported fields
}
PrometheusHook tracks log metrics.
func NewPrometheusHook ¶
func NewPrometheusHook() *PrometheusHook
NewPrometheusHook creates prometheus metrics.
func (*PrometheusHook) Fire ¶
func (h *PrometheusHook) Fire(e *log.Entry) error
Fire updates prometheus log metrics.
func (*PrometheusHook) Levels ¶
func (h *PrometheusHook) Levels() []log.Level
Levels returns the log levels for the countres.
Click to show internal directories.
Click to hide internal directories.