metrics

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HcoMetrics = func() hcoMetrics {
	metricDescList := map[string]metricDesc{
		"overwrittenModifications": {
			fqName:          "kubevirt_hco_out_of_band_modifications_count",
			help:            "Count of out-of-band modifications overwritten by HCO",
			constLabelPairs: []string{counterLabelCompName},
			initFunc: func(md metricDesc) prometheus.Collector {
				return prometheus.NewCounterVec(
					prometheus.CounterOpts{
						Name: md.fqName,
						Help: md.help,
					},
					md.constLabelPairs,
				)
			},
		},
		"unsafeModifications": {
			fqName:          "kubevirt_hco_unsafe_modification_count",
			help:            "Count of unsafe modifications in the HyperConverged annotations",
			constLabelPairs: []string{counterLabelAnnName},
			initFunc: func(md metricDesc) prometheus.Collector {
				return prometheus.NewGaugeVec(
					prometheus.GaugeOpts{
						Name: md.fqName,
						Help: md.help,
					},
					md.constLabelPairs,
				)
			},
		},
	}

	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
}

Jump to

Keyboard shortcuts

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