Documentation ¶
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 exposes Prometheus counters for each of logrus' log levels.
func NewPrometheusHook ¶
func NewPrometheusHook() (*PrometheusHook, error)
NewPrometheusHook creates a new instance of PrometheusHook which exposes Prometheus counters for various log levels.
func (*PrometheusHook) Fire ¶
func (hook *PrometheusHook) Fire(entry *logrus.Entry) error
Fire increments the appropriate Prometheus counter depending on the entry's log level.
func (*PrometheusHook) Levels ¶
func (hook *PrometheusHook) Levels() []logrus.Level
Levels returns all supported log levels, i.e.: Debug, Info, Warn and Error, as there is no point incrementing a counter just before exiting/panicking.
Click to show internal directories.
Click to hide internal directories.