metrics

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PmemCSIDeploymentSubsystemKey represents the key used for
	// PMEM-CSI deployment metrics sub-system.
	PmemCSIDeploymentSubsystemKey = "pmem_csi_deployment"
)

Variables

View Source
var (
	// Reconcile creates new prometheus metrics counter
	// that gets incremented on each reconcile loop
	// of a PmemCSIDeployment CR, with information: {"name", "uid"}.
	Reconcile = prometheus.NewCounterVec(prometheus.CounterOpts{
		Subsystem: PmemCSIDeploymentSubsystemKey,
		Name:      "reconcile",
		Help:      "Number of reconcile loops gone through by a PmemCSIDeployment CR.",
	}, []string{"name", "uid"})

	// SubResourceCreatedAt creates new prometheus metrics for
	// a sub resource deployed for a PmemCSIDeployment,
	// with information: {"name", "namespace", "group", "version", "kind", "uid", "ownedBy"}
	SubResourceCreatedAt = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Subsystem: PmemCSIDeploymentSubsystemKey,
		Name:      "sub_resource_created_at",
		Help:      "Timestamp at which a sub resource was created.",
	}, []string{"name", "namespace", "group", "version", "kind", "uid", "ownedBy"})

	// SubResourceUpdatedAt creates new prometheus metrics for
	// a sub resource redeployed for a PmemCSIDeployment,
	// with information: {"name", "namespace", "group", "version", "kind", "uid", "ownedBy"}
	SubResourceUpdatedAt = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Subsystem: PmemCSIDeploymentSubsystemKey,
		Name:      "sub_resource_updated_at",
		Help:      "Timestamp at which a sub resource was update.",
	}, []string{"name", "namespace", "group", "version", "kind", "uid", "ownedBy"})
)

Functions

func GetSubResourceLabels

func GetSubResourceLabels(obj client.Object) map[string]string

func RegisterMetrics

func RegisterMetrics()

func SetReconcileMetrics

func SetReconcileMetrics(name, uid string) error

func SetSubResourceCreateMetric

func SetSubResourceCreateMetric(obj client.Object) error

func SetSubResourceUpdateMetric

func SetSubResourceUpdateMetric(obj client.Object) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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