metrics

package
v0.0.0-...-d7985ca Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: Apache-2.0 Imports: 3 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// Common namespace for application metrics.
	Namespace = "karpenter"

	ErrorLabel       = "error"
	ProvisionerLabel = "provisioner"
	ReasonLabel      = "reason"

	// Reasons for CREATE/DELETE shared metrics
	DeprovisioningReason = "deprovisioning"
	ConsolidationReason  = "consolidation"
	ProvisioningReason   = "provisioning"
	ExpirationReason     = "expiration"
	EmptinessReason      = "emptiness"
	DriftReason          = "drift"
)

Variables

View Source
var (
	NodesCreatedCounter = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: Namespace,
			Subsystem: nodeSubsystem,
			Name:      "created",
			Help:      "Number of nodes created in total by Karpenter. Labeled by reason the node was created and the owning provisioner.",
		},
		[]string{
			ReasonLabel,
			ProvisionerLabel,
		},
	)
	NodesTerminatedCounter = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: Namespace,
			Subsystem: nodeSubsystem,
			Name:      "terminated",
			Help:      "Number of nodes terminated in total by Karpenter. Labeled by reason the node was terminated and the owning provisioner.",
		},
		[]string{
			ReasonLabel,
			ProvisionerLabel,
		},
	)
	MachinesCreatedCounter = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: Namespace,
			Subsystem: machineSubsystem,
			Name:      "created",
			Help:      "Number of machines created in total by Karpenter. Labeled by reason the machine was created.",
		},
		[]string{
			"reason",
		},
	)
	MachinesTerminatedCounter = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: Namespace,
			Subsystem: machineSubsystem,
			Name:      "terminated",
			Help:      "Number of machines terminated in total by Karpenter. Labeled by reason the machine was terminated.",
		},
		[]string{
			"reason",
		},
	)
)

Functions

func DurationBuckets

func DurationBuckets() []float64

DurationBuckets returns a []float64 of default threshold values for duration histograms. Each returned slice is new and may be modified without impacting other bucket definitions.

func Measure

func Measure(observer prometheus.Observer) func()

Measure returns a deferrable function that observes the duration between the defer statement and the end of the function.

func MustRegister

func MustRegister()

func SummaryObjectives

func SummaryObjectives() map[float64]float64

Returns a map of summary objectives (quantile-error pairs)

Types

This section is empty.

Jump to

Keyboard shortcuts

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