metrics

package
v1.10.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	HCOMetricOverwrittenModifications = "overwrittenModifications"
	HCOMetricUnsafeModifications      = "unsafeModifications"
	HCOMetricHyperConvergedExists     = "HyperConvergedCRExists"
	HCOMetricSystemHealthStatus       = "systemHealthStatus"
	HCOMetricSingleStackIPv6          = "singleStackIpv6"

	HyperConvergedExists    = float64(1)
	HyperConvergedNotExists = float64(0)

	SingleStackIPv6True  = float64(1)
	SingleStackIPv6False = float64(0)
)
View Source
const (
	SystemHealthStatusHealthy float64 = iota
	SystemHealthStatusWarning
	SystemHealthStatusError
)

Variables

View Source
var HcoMetrics = func() hcoMetrics {
	metricDescList := map[string]metricDesc{
		HCOMetricOverwrittenModifications: {
			fqName:          "kubevirt_hco_out_of_band_modifications_total",
			help:            "Count of out-of-band modifications overwritten by HCO",
			mType:           "Counter",
			constLabelPairs: []string{counterLabelCompName},
			initFunc: func(md metricDesc) prometheus.Collector {
				return prometheus.NewCounterVec(
					prometheus.CounterOpts{
						Name: md.fqName,
						Help: md.help,
					},
					md.constLabelPairs,
				)
			},
		},
		HCOMetricUnsafeModifications: {
			fqName:          "kubevirt_hco_unsafe_modifications",
			help:            "Count of unsafe modifications in the HyperConverged annotations",
			mType:           "Gauge",
			constLabelPairs: []string{counterLabelAnnName},
			initFunc: func(md metricDesc) prometheus.Collector {
				return prometheus.NewGaugeVec(
					prometheus.GaugeOpts{
						Name: md.fqName,
						Help: md.help,
					},
					md.constLabelPairs,
				)
			},
		},
		HCOMetricHyperConvergedExists: {
			fqName:          "kubevirt_hco_hyperconverged_cr_exists",
			help:            "Indicates whether the HyperConverged custom resource exists (1) or not (0)",
			mType:           "Gauge",
			constLabelPairs: []string{counterLabelAnnName},
			initFunc: func(md metricDesc) prometheus.Collector {
				return prometheus.NewGauge(
					prometheus.GaugeOpts{
						Name: md.fqName,
						Help: md.help,
					},
				)
			},
		},
		HCOMetricSystemHealthStatus: {
			fqName:          "kubevirt_hco_system_health_status",
			help:            "Indicates whether the system health status is healthy (0), warning (1), or error (2), by aggregating the conditions of HCO and its secondary resources",
			mType:           "Gauge",
			constLabelPairs: []string{counterLabelAnnName},
			initFunc: func(md metricDesc) prometheus.Collector {
				return prometheus.NewGauge(
					prometheus.GaugeOpts{
						Name: md.fqName,
						Help: md.help,
					},
				)
			},
		},
		HCOMetricSingleStackIPv6: {
			fqName:          "kubevirt_hco_single_stack_ipv6",
			help:            "Indicates whether the underlying cluster is single stack IPv6 (1) or not (0)",
			mType:           "Gauge",
			constLabelPairs: []string{counterLabelAnnName},
			initFunc: func(md metricDesc) prometheus.Collector {
				return prometheus.NewGauge(
					prometheus.GaugeOpts{
						Name: md.fqName,
						Help: md.help,
					})
			},
		},
	}

	metricList := make(map[string]prometheus.Collector)
	for k, md := range metricDescList {
		metricList[k] = md.init()
	}

	return hcoMetrics{
		metricDescList: metricDescList,
		metricList:     metricList,
	}
}()

HcoMetrics wrapper for all hco metrics

Functions

This section is empty.

Types

type MetricDescription added in v1.6.0

type MetricDescription struct {
	FqName string
	Help   string
	Type   string
}

Jump to

Keyboard shortcuts

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