metrics

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: BSD-2-Clause Imports: 2 Imported by: 1 module, 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

Index

Constants

View Source
const (
	ReasonInvalidFrontmatter          = "invalid_frontmatter"
	ReasonDuplicateFrontmatterInvalid = "duplicate_frontmatter_invalid"
	ReasonEmptyStatus                 = "empty_status"
	ReasonInjectTaskIdentifierFailed  = "inject_task_identifier_failed"
	ReasonReadFailed                  = "read_failed"
	ReasonAutoInjectDisabled          = "auto_inject_disabled"
)

Variables

View Source
var ConflictResolutionsTotal = promauto.NewCounterVec(
	prometheus.CounterOpts{
		Name: "agent_controller_conflict_resolutions_total",
		Help: "Total number of per-file conflict resolution attempts.",
	},
	[]string{"result"},
)

ConflictResolutionsTotal counts per-file conflict resolution attempts by outcome.

View Source
var FrontmatterCommandsTotal = promauto.NewCounterVec(
	prometheus.CounterOpts{
		Name: "agent_controller_frontmatter_commands_total",
		Help: "Total number of atomic frontmatter commands processed, by operation and outcome.",
	},
	[]string{"operation", "outcome"},
)

FrontmatterCommandsTotal counts atomic frontmatter command executions by operation ("increment-frontmatter" | "update-frontmatter") and outcome ("success" | "error" | "not_found").

View Source
var GitPushTotal = promauto.NewCounterVec(
	prometheus.CounterOpts{
		Name: "agent_controller_git_push_total",
		Help: "Total number of git push attempts.",
	},
	[]string{"result"},
)

GitPushTotal counts git push attempts by outcome.

View Source
var GitRestCallsTotal = promauto.NewCounterVec(
	prometheus.CounterOpts{
		Name: "agent_controller_git_rest_calls_total",
		Help: "Total number of git-rest HTTP API calls by operation and outcome.",
	},
	[]string{"op", "status"},
)

GitRestCallsTotal counts git-rest HTTP API calls by operation and outcome.

View Source
var KafkaConsumePausedTotal = promauto.NewCounter(prometheus.CounterOpts{
	Name: "controller_kafka_consume_paused_total",
	Help: "Total number of times Kafka consumption was paused waiting for git-rest.",
})

KafkaConsumePausedTotal counts times a Kafka command executor blocked waiting for git-rest to become available (i.e. retry attempts after the first).

View Source
var PlanningRetryTotal = promauto.NewCounterVec(
	prometheus.CounterOpts{
		Name: "agent_controller_planning_retry_total",
		Help: "Total number of controller-side pr-review planning-retry gate outcomes, by result.",
	},
	[]string{"result"},
)

PlanningRetryTotal counts controller-side pr-review planning-retry gate outcomes by result ("retry" | "exhausted"). "passthrough" is intentionally NOT a label — the metric fires only when the retry gate matches (spec DB 7).

View Source
var ResultsWrittenTotal = promauto.NewCounterVec(
	prometheus.CounterOpts{
		Name: "agent_controller_results_written_total",
		Help: "Total number of task result write attempts.",
	},
	[]string{"result"},
)

ResultsWrittenTotal counts result write attempts by outcome.

View Source
var ScanCyclesTotal = promauto.NewCounterVec(
	prometheus.CounterOpts{
		Name: "agent_controller_scan_cycles_total",
		Help: "Total number of scan cycles completed.",
	},
	[]string{"result"},
)

ScanCyclesTotal counts scan cycle completions by result.

View Source
var SkippedFilesTotal = promauto.NewCounterVec(
	prometheus.CounterOpts{
		Name: "agent_controller_vault_scanner_skipped_files_total",
		Help: "Total number of vault task files the scanner skipped during a scan cycle, by reason. Increments exactly once per skipped file per cycle — re-scans of an unrepaired broken file keep the rate positive.",
	},
	[]string{"reason"},
)

SkippedFilesTotal counts vault task files the scanner skipped during a scan cycle, labelled by the structured reason for the skip. A non-zero value on any label indicates operator-actionable vault health issues (broken frontmatter, empty status, unreadable files, injection failures); a stuck broken file will keep the relevant label rate-positive until repaired. The closed set of reason values is declared as constants above and pre-initialised in init().

View Source
var TasksPublishedTotal = promauto.NewCounterVec(
	prometheus.CounterOpts{
		Name: "agent_controller_tasks_published_total",
		Help: "Total number of task events published.",
	},
	[]string{"type"},
)

TasksPublishedTotal counts task events published by type.

Functions

This section is empty.

Types

type Metrics

type Metrics interface {
	ScanCyclesTotal(outcome string) prometheus.Counter
	TasksPublishedTotal(outcome string) prometheus.Counter
	ResultsWrittenTotal(outcome string) prometheus.Counter
	GitPushTotal(outcome string) prometheus.Counter
	ConflictResolutionsTotal() prometheus.Counter
	FrontmatterCommandsTotal(operation, outcome string) prometheus.Counter
	GitRestCallsTotal(operation, status string) prometheus.Counter
	KafkaConsumePausedTotal() prometheus.Counter
	SkippedFilesTotal(reason string) prometheus.Counter
}

Metrics defines the interface for accessing Prometheus metrics. Use this interface in business logic packages to enable mock injection in tests.

func New

func New() Metrics

New returns a new default Metrics implementation.

Jump to

Keyboard shortcuts

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