metrics

package
v0.5.12 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package metrics provides a simple interface for collecting metrics.

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultRegistry is a default prometheus registry.
	DefaultRegistry = NewRegistry()

	// DefaultRegisterer is a default prometheus registerer.
	DefaultRegisterer prometheus.Registerer = DefaultRegistry

	// DefaultGatherer is a default prometheus gatherer.
	DefaultGatherer prometheus.Gatherer = DefaultRegistry
)

Functions

This section is empty.

Types

type Collector

type Collector interface {
	// Collect ...
	Collect(ch chan<- Metric)
}

Collector is a type that can collect metrics.

type Gatherer

type Gatherer interface {
	// Gather ...
	Gather(collector Collector)
}

Gatherer is a type that can gather metrics.

type Metric

type Metric interface {
	// Write ...
	Write(m Monitor) error
}

Metric is a type that can be collected.

type Monitor

type Monitor interface {
	// Write ...
	Write(m Metric) error
}

Monitor is a type that can monitor metrics.

type Probe

type Probe[K, V any] interface {
	// Do ...
	Do(ctx context.Context, monitor Monitor) error

	Collector
}

Probe is a type that can probe metrics.

type Registry

type Registry struct {
	*prometheus.Registry
}

Registry is a prometheus registry.

func NewRegistry

func NewRegistry() *Registry

NewRegistry is a constructor for Registry.

func (*Registry) Handler

func (r *Registry) Handler() http.Handler

Handler returns a HTTP handler for this registry. Should be registered at "/metrics".

Jump to

Keyboard shortcuts

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