metrics

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SLOControllerSubsystem = "slo_controller"

	NodeKey = "node"

	StatusKey       = "status"
	StatusSucceeded = "succeeded"
	StatusFailed    = "failed"

	ReasonKey   = "reason"
	PluginKey   = "plugin"
	ResourceKey = "resource"

	UnitKey     = "unit"
	UnitCore    = "core"
	UnitByte    = "byte"
	UnitInteger = "integer"
)
View Source
const (
	// DefaultHTTPPath use /all-metrics since /metrics is occupied by controller manager default registry
	DefaultHTTPPath  = "/all-metrics"
	ExternalHTTPPath = "/external-metrics"
	InternalHTTPPath = "/internal-metrics"
)

Variables

View Source
var (
	NodeResourceReconcileCount = prometheus.NewCounterVec(prometheus.CounterOpts{
		Subsystem: SLOControllerSubsystem,
		Name:      "node_resource_reconcile_count",
		Help:      "the status count of reconciling node resource",
	}, []string{StatusKey, ReasonKey})

	NodeMetricReconcileCount = prometheus.NewCounterVec(prometheus.CounterOpts{
		Subsystem: SLOControllerSubsystem,
		Name:      "nodemetric_reconcile_count",
		Help:      "the status count of reconciling NodeMetric",
	}, []string{StatusKey, ReasonKey})

	NodeMetricSpecParseCount = prometheus.NewCounterVec(prometheus.CounterOpts{
		Subsystem: SLOControllerSubsystem,
		Name:      "nodemetric_spec_parse_count",
		Help:      "the count of parsing NodeMetric spec",
	}, []string{StatusKey, ReasonKey})

	NodeSLOReconcileCount = prometheus.NewCounterVec(prometheus.CounterOpts{
		Subsystem: SLOControllerSubsystem,
		Name:      "nodeslo_reconcile_count",
		Help:      "the status count of reconciling NodeSLO",
	}, []string{StatusKey, ReasonKey})

	NodeSLOSpecParseCount = prometheus.NewCounterVec(prometheus.CounterOpts{
		Subsystem: SLOControllerSubsystem,
		Name:      "nodeslo_spec_parse_count",
		Help:      "the count of parsing NodeSLO spec",
	}, []string{StatusKey, ReasonKey})

	CommonCollectors = []prometheus.Collector{
		NodeResourceReconcileCount,
		NodeMetricReconcileCount,
		NodeMetricSpecParseCount,
		NodeSLOReconcileCount,
		NodeSLOSpecParseCount,
	}
)
View Source
var (
	// ExternalRegistry	register metrics for users
	ExternalRegistry = prometheus.NewRegistry()

	// InternalRegistry only register metrics of koord-manager itself for performance and functional monitor
	InternalRegistry = legacyregistry.DefaultGatherer
)
View Source
var (
	NodeResourceRunPluginStatus = prometheus.NewCounterVec(prometheus.CounterOpts{
		Subsystem: SLOControllerSubsystem,
		Name:      "node_resource_run_plugin_status",
		Help:      "the status count of running node resource plugins",
	}, []string{PluginKey, StatusKey, ReasonKey})

	NodeExtendedResourceAllocatableInternal = metrics.NewGCGaugeVec("node_extended_resource_allocatable_internal", prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Subsystem: SLOControllerSubsystem,
		Name:      "node_extended_resource_allocatable_internal",
		Help:      "the internal allocatable of node extended resources which may not be updated at the node status",
	}, []string{NodeKey, ResourceKey, UnitKey}))

	NodeResourceCollectors = []prometheus.Collector{
		NodeResourceRunPluginStatus,
		NodeExtendedResourceAllocatableInternal.GetGaugeVec(),
	}
)

Functions

func ExternalMustRegister added in v1.4.1

func ExternalMustRegister(cs ...prometheus.Collector)

func InternalMustRegister added in v1.4.1

func InternalMustRegister(cs ...prometheus.Collector)

func RecordNodeExtendedResourceAllocatableInternal

func RecordNodeExtendedResourceAllocatableInternal(node *corev1.Node, resourceName string, unit string, value float64)

func RecordNodeMetricReconcileCount

func RecordNodeMetricReconcileCount(isSucceeded bool, reason string)

func RecordNodeMetricSpecParseCount

func RecordNodeMetricSpecParseCount(isSucceeded bool, reason string)

func RecordNodeResourceReconcileCount

func RecordNodeResourceReconcileCount(isSucceeded bool, reason string)

func RecordNodeResourceRunPluginStatus

func RecordNodeResourceRunPluginStatus(pluginName string, isSucceeded bool, reason string)

func RecordNodeSLOReconcileCount

func RecordNodeSLOReconcileCount(isSucceeded bool, reason string)

func RecordNodeSLOSpecParseCount

func RecordNodeSLOSpecParseCount(isSucceeded bool, reason string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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