metrics

package
v1.0.10-0...-7349ede Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

type Collector interface {
	Refresher
	Metrics(*Prometheus) []prometheus.Collector
}

Collector represents the methods for collecting metrics

type Config

type Config struct {
	DBName            string        // use DBName as metrics label
	RefreshInterval   time.Duration // refresh metrics interval.
	StartServer       bool          // if true, create http server to expose metrics
	HTTPServerPort    uint32        // http server port
	MetricsCollectors []Collector   // collector
}

type Prometheus

type Prometheus struct {
	*Config
	Logger log.Logger

	Labels map[string]string
	// contains filtered or unexported fields
}

func New

func New(config Config) *Prometheus

func (*Prometheus) Initialize

func (p *Prometheus) Initialize() error

type Refresher

type Refresher interface {
	Refresh()
}

Refresher represents the methods for refreshing metrics

Jump to

Keyboard shortcuts

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