metrics

package
v3.23.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllStatuses = []Status{ActiveStatus, ErrorStatus}

AllStatuses is the set of all allowed values of Status.

AllVAPStatuses is the set of all allowed values of VAPStatus.

Functions

func AddToManager

func AddToManager(m manager.Manager) error

func DisableRESTClientMetrics

func DisableRESTClientMetrics()

DisableRESTClientMetrics disables the rest client latency histograms configured by controller-runtime in sigs.k8s.io/controller-runtime/pkg/metrics/client_go_adapter.go#registerClientMetrics.

Types

type Status

type Status string

Status is whether a ConstraintTemplate is functioning properly. Reported in metrics.

const (
	// ActiveStatus indicates a ConstraintTemplate is operating normally.
	ActiveStatus Status = "active"
	// ErrorStatus indicates there is a problem with a ConstraintTemplate.
	ErrorStatus Status = "error"
)

type VAPStatus added in v3.22.0

type VAPStatus string

VAPStatus represents the status of a VAP resource. Reported in metrics.

const (
	// VAPStatusActive indicates a VAP is operating normally.
	VAPStatusActive VAPStatus = "active"
	// VAPStatusError indicates there is a problem with a VAP.
	VAPStatusError VAPStatus = "error"
)

type VAPStatusRegistry added in v3.22.0

type VAPStatusRegistry struct {
	// contains filtered or unexported fields
}

VAPStatusRegistry tracks VAP/VAPB resources by their status for accurate counting. This is a thread-safe registry that can be used by both constraint and constrainttemplate controllers to track VAP-related resource statuses.

func NewVAPStatusRegistry added in v3.22.0

func NewVAPStatusRegistry() *VAPStatusRegistry

NewVAPStatusRegistry creates a new VAPStatusRegistry instance.

func (*VAPStatusRegistry) Add added in v3.22.0

func (r *VAPStatusRegistry) Add(key types.NamespacedName, status VAPStatus)

Add adds or updates a resource's status in the registry. If the resource already exists with the same status, this is a no-op.

func (*VAPStatusRegistry) ComputeTotals added in v3.22.0

func (r *VAPStatusRegistry) ComputeTotals() map[VAPStatus]int64

ComputeTotals returns the count of resources for each status.

func (*VAPStatusRegistry) Remove added in v3.22.0

func (r *VAPStatusRegistry) Remove(key types.NamespacedName)

Remove removes a resource from the registry.

Directories

Path Synopsis
exporters
Package registry provides a dynamic registry of available exporters.
Package registry provides a dynamic registry of available exporters.

Jump to

Keyboard shortcuts

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