logmon

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: BSD-3-Clause Imports: 3 Imported by: 1

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.

Jump to

Keyboard shortcuts

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