logmetrics

package
v0.0.0-...-a8bb791 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: Apache-2.0, Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

type Metrics map[logrus.Level]prometheus.Counter

Metrics is a logrus hook-compliant struct that records metrics about logging when added to a logrus.Logger

func New

func New(namespace string) Metrics

New creates a new hook for recording metrics. New takes a namespace parameter which defines the namespace for the prometheus metrics.

func (Metrics) Fire

func (m Metrics) Fire(e *logrus.Entry) error

Fire is triggered by logrus, in response to a logging event

func (Metrics) Levels

func (m Metrics) Levels() []logrus.Level

Levels returns the logging levels that will trigger this hook to run. In this case, all of them.

Jump to

Keyboard shortcuts

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