metrics

package
v0.0.0-test.load Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2025 License: Apache-2.0, Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Namespace(s).
	Namespace = "karpenter"

	// Label key(s).
	ImageLabel        = "image"
	ErrorCodeLabel    = "error_code"
	SizeLabel         = "size"
	ZoneLabel         = "zone"
	CapacityTypeLabel = "capacity_type"
	NodePoolLabel     = "nodepool"
	PhaseLabel        = "phase"
)

Variables

View Source
var (
	VMCreateStartMetric = &metric{
		name: "VMCreateStart",
	}
	VMCreateSyncFailureMetric = &metric{
		name: "VMCreateSyncFailure",
	}
	VMCreateAsyncFailureMetric = &metric{
		name: "VMCreateAsyncFailure",
	}
	VMCreateResponseError = &metric{
		name: "ResponseError",
	}
)
View Source
var (
	ImageSelectionErrorCount = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: Namespace,
			Subsystem: imageFamilySubsystem,
			Name:      "selection_error_count",
			Help:      "The number of errors encountered while selecting an image.",
		},
		[]string{"family"},
	)
)

Functions

func FailureMetricLabels added in v1.6.6

func FailureMetricLabels(base map[string]string, phase string, extra ...map[string]string) map[string]string

FailureMetricLabels produces a failure metric label set by merging the provided base labels with the phase label and any additional label maps. Later maps override earlier values when conflicts occur.

func FindMetricWithLabelValues added in v1.6.6

func FindMetricWithLabelValues(metricName string, labels map[string]string) (*dto.Metric, error)

FindMetricWithLabelValues locates a metric by name and label values within the controller-runtime registry. It returns the metric (or nil if not found) and any error produced while gathering metrics.

func ValuesToKeyValuePairs added in v1.6.2

func ValuesToKeyValuePairs(values ...Value) []any

Helper function to convert a slice of Values to their key-value pairs

Types

type Value added in v1.6.2

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

Value represents a key-value pair for logging with a known key

func ImageID added in v1.6.2

func ImageID(value string) Value

func ResponseError added in v1.6.3

func ResponseError(value string) Value

func (Value) Key added in v1.6.2

func (m Value) Key() string

Key returns the logging key

func (Value) Value added in v1.6.2

func (m Value) Value() any

Value returns the logging value

Jump to

Keyboard shortcuts

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