metrics

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

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