metrics

package
v0.2.13 Latest Latest
Warning

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

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

Documentation

Overview

Package metrics defines the Prometheus series the controller and the agent export. Each owns a private registry rather than the global default, so tests and multiple servers in one process never collide on registration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	Registry          *prometheus.Registry
	SlotsBusy         prometheus.Gauge
	SlotsTotal        prometheus.Gauge
	ProvisionSeconds  prometheus.Observer
	ProvisionFailures prometheus.Counter
	DiskBlocked       prometheus.Gauge
	GitHubAPIErrors   *prometheus.CounterVec
	BreakerOpen       *prometheus.GaugeVec
	PollErrors        prometheus.Counter
}

Agent holds the runner host's series. The driver label is fixed per process, so the per-driver series are curried at construction.

func NewAgent

func NewAgent(driver string) *Agent

NewAgent registers the agent series for the named driver.

func (*Agent) Handler

func (m *Agent) Handler() http.Handler

Handler serves the registry in the Prometheus exposition format.

type Controller

type Controller struct {
	Registry        *prometheus.Registry
	Offers          prometheus.Counter
	Claims          prometheus.Counter
	DispatchLatency prometheus.Histogram
	AgentsLost      prometheus.Counter
}

Controller holds the control plane's scheduling series.

func NewController

func NewController(activeAgents, queuedJobs func() float64) *Controller

NewController registers the controller series. activeAgents and queuedJobs are read at scrape time from the server's own liveness state.

func (*Controller) Handler

func (m *Controller) Handler() http.Handler

Handler serves the registry in the Prometheus exposition format.

Jump to

Keyboard shortcuts

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