metrics

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Overview

Package metrics defines the Prometheus collectors of a Foreman client.

Index

Constants

View Source
const DefaultLabelCap = 50
View Source
const Other = "other"

Variables

View Source
var (
	DurationBuckets = []float64{
		0.001, 0.0025, 0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10, 30, 60, 300, 900, 3600,
	}
	LatencyBuckets = []float64{
		0.001, 0.0025, 0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10, 30, 60, 300, 3600,
	}
	FetchBuckets = []float64{0.0001, 0.00025, 0.0005, 0.001, 0.0025, 0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 1, 5}
)

Functions

This section is empty.

Types

type Capper

type Capper struct {
	// contains filtered or unexported fields
}

func NewCapper

func NewCapper(maxValues int) *Capper

func (*Capper) Value

func (c *Capper) Value(v string) string

type Metrics

type Metrics struct {
	Inserted        *prometheus.CounterVec
	Completed       *prometheus.CounterVec
	Duration        *prometheus.HistogramVec
	QueueLatency    *prometheus.HistogramVec
	QueueDepth      *prometheus.GaugeVec
	Running         *prometheus.GaugeVec
	Leader          prometheus.Gauge
	Rescued         prometheus.Counter
	Stale           prometheus.Counter
	PeriodicSkipped *prometheus.CounterVec
	Unserved        *prometheus.CounterVec
	FetchDuration   *prometheus.HistogramVec
	MaintenanceRun  *prometheus.GaugeVec
	MaintenanceRows *prometheus.CounterVec
	BuildInfo       *prometheus.GaugeVec
	// contains filtered or unexported fields
}

Metrics holds the Prometheus collectors of a client.

func New

func New(reg prometheus.Registerer) (*Metrics, error)

New creates the collectors and registers them with reg.

func (*Metrics) Kind

func (m *Metrics) Kind(k string) string

func (*Metrics) Name

func (m *Metrics) Name(n string) string

func (*Metrics) ObserveMaintenance

func (m *Metrics) ObserveMaintenance(service string, rows int, at time.Time)

func (*Metrics) Queue

func (m *Metrics) Queue(q string) string

Jump to

Keyboard shortcuts

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