metrics

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: Apache-2.0 Imports: 4 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

Overview

Package metrics contains prometheus metric definitions for the epoxy server.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Stage1Total counts the number of host boots.
	Stage1Total = promauto.NewCounterVec(
		prometheus.CounterOpts{
			Name: "epoxy_stage1_total",
			Help: "Total number of boots per machine.",
		},

		[]string{"machine"},
	)

	// RequestDuration profiles request latency.
	RequestDuration = promauto.NewHistogramVec(
		prometheus.HistogramOpts{
			Name: "epoxy_request_duration_seconds",
			Help: "A histogram of request latencies.",
		},
		[]string{"code"},
	)
)

Functions

This section is empty.

Types

type Collector

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

Collector defines a custom collector for reading metrics from datastore.

func NewCollector

func NewCollector(metricName string, config Config) *Collector

NewCollector creates a new datastore collector instance. The metricName should be one of "epoxy_last_boot" or "epoxy_last_success".

func (*Collector) Collect

func (col *Collector) Collect(ch chan<- prometheus.Metric)

Collect satisfies the prometheus.Collector interface. Collect reports values from hosts datastore.

func (*Collector) Describe

func (col *Collector) Describe(ch chan<- *prometheus.Desc)

Describe satisfies the prometheus.Collector interface. Describe is called immediately after registering the collector.

type Config

type Config interface {
	List() ([]*storage.Host, error)
}

Config provides access to Host records.

Jump to

Keyboard shortcuts

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