metrics

package
v0.62.9 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildJobMetricsName

func BuildJobMetricsName(agentName string) string

BuildJobMetricsName returns the standardized PushGateway job name for an agent job binary. All agent binaries must use this function to ensure the job name is consistent across deployments.

Example: BuildJobMetricsName("claude-agent") → "agent_job_claude_agent"

Types

type JobMetrics

type JobMetrics interface {
	// RecordRun atomically increments the run counter and sets the last-run
	// gauge for the given status label. Both operations use the same label
	// value; they cannot drift.
	RecordRun(status agentlib.AgentStatus)
	// RecordDuration observes the run duration histogram.
	RecordDuration(d time.Duration)
}

JobMetrics records per-job Prometheus metrics at the result-publish boundary.

func NewJobMetrics

func NewJobMetrics(
	registry *prometheus.Registry,
	currentDateTime libtime.CurrentDateTime,
) JobMetrics

NewJobMetrics creates a JobMetrics that registers three collectors onto the caller-owned registry. The caller must NOT pass nil for registry. Registration failures (e.g. duplicate registration) panic — they are programmer errors caught at startup.

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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