prometheus

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: MIT Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Listen    string
	Namespace string
	Subsystem string
	Cert      string
	Key       string
	Cacert    string
}

Configuration the configuration for prometheus

type Prometheus

type Prometheus struct {
	Config   *Configuration
	Logger   *zap.Logger
	Registry *prom.Registry
}

Prometheus contains the prometheus registry and config

func New

func New() (*Prometheus, error)

New creates a new Prometheus component

func (*Prometheus) Handler

func (p *Prometheus) Handler() http.Handler

Handler returns the handler for the prometheus component

func (*Prometheus) Register

func (p *Prometheus) Register(collector prom.Collector) error

Register adds a metric to the component

func (*Prometheus) Unregister

func (p *Prometheus) Unregister(collector prom.Collector)

Unregister removes a metric from the component

Jump to

Keyboard shortcuts

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