metrics

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ReconcileTotal counts reconcile attempts by outcome.
	ReconcileTotal = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "opm_controller_reconcile_total",
			Help: "Total number of reconcile attempts by outcome.",
		},
		[]string{"name", "namespace", "outcome"},
	)

	// ReconcileDuration observes reconcile duration in seconds.
	ReconcileDuration = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Name:    "opm_controller_reconcile_duration_seconds",
			Help:    "Duration of reconcile attempts in seconds.",
			Buckets: prometheus.DefBuckets,
		},
		[]string{"name", "namespace"},
	)

	// ApplyResourcesTotal counts resources applied by action.
	ApplyResourcesTotal = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "opm_controller_apply_resources_total",
			Help: "Total number of resources applied by action.",
		},
		[]string{"name", "namespace", "action"},
	)

	// PruneResourcesTotal counts resources pruned.
	PruneResourcesTotal = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "opm_controller_prune_resources_total",
			Help: "Total number of resources pruned.",
		},
		[]string{"name", "namespace"},
	)

	// InventorySize reports the current inventory entry count.
	InventorySize = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "opm_controller_inventory_size",
			Help: "Current number of entries in the inventory.",
		},
		[]string{"name", "namespace"},
	)
)

Functions

func RecordApply

func RecordApply(name, namespace string, created, updated, unchanged int)

RecordApply records apply resource counts by action.

func RecordDuration

func RecordDuration(name, namespace string, duration time.Duration)

RecordDuration records only the reconcile duration without an outcome counter. Used for suspend and deletion paths that don't have a reconcile outcome.

func RecordPrune

func RecordPrune(name, namespace string, deleted int)

RecordPrune records the number of resources pruned.

func RecordReconcile

func RecordReconcile(name, namespace, outcome string, duration time.Duration)

RecordReconcile records the outcome and duration of a reconcile attempt.

func SetInventorySize

func SetInventorySize(name, namespace string, size int)

SetInventorySize sets the current inventory size gauge.

Types

This section is empty.

Jump to

Keyboard shortcuts

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