metrics

package
v0.10.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// LogReconcileLongDurationThreshold defines the duration after which long function
	// duration will be logged.
	LogReconcileLongDurationThreshold = 10 * time.Second

	ClusterNotReady = "notready"
	ClusterReady    = "ready"
	ClusterOffline  = "offline"
)

Variables

View Source
var (
	ControllerRuntimeReconcileTotal = prometheus.NewCounterVec(prometheus.CounterOpts{
		Name: "controller_runtime_reconcile_total",
		Help: "Total number of reconciliations per controller",
	}, []string{"controller", "result"})

	ControllerRuntimeReconcileErrors = prometheus.NewCounterVec(prometheus.CounterOpts{
		Name: "controller_runtime_reconcile_errors_total",
		Help: "Total number of reconciliation errors per controller",
	}, []string{"controller"})

	ControllerRuntimeReconcileTime = prometheus.NewHistogramVec(prometheus.HistogramOpts{
		Name: "controller_runtime_reconcile_time_seconds",
		Help: "Length of time per reconciliation per controller",
		Buckets: []float64{0.005, 0.01, 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0,
			1.25, 1.5, 1.75, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30, 40, 50, 60},
	}, []string{"controller"})

	ControllerRuntimeWorkerCount = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Name: "controller_runtime_max_concurrent_reconciles",
		Help: "Maximum number of concurrent reconciles per controller",
	}, []string{"controller"})

	ControllerRuntimeActiveWorkers = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Name: "controller_runtime_active_workers",
		Help: "Number of currently used workers per controller",
	}, []string{"controller"})
)

Functions

func ClusterClientConnectionDurationFromStart

func ClusterClientConnectionDurationFromStart(start time.Time)

ClusterClientConnectionDurationFromStart records the duration of the cluster client connection operation

func ClusterHealthStatusDurationFromStart

func ClusterHealthStatusDurationFromStart(start time.Time)

ClusterHealthStatusDurationFromStart records the duration of the cluster health status operation

func DispatchOperationDurationFromStart

func DispatchOperationDurationFromStart(action string, start time.Time)

DispatchOperationDurationFromStart records the duration of the step identified by the action name

func JoinedClusterDurationFromStart

func JoinedClusterDurationFromStart(start time.Time)

JoinedClusterDurationFromStart records the duration of the cluster joined operation

func JoinedClusterTotalDec

func JoinedClusterTotalDec()

JoinedClusterTotalDec decreases by one the number of joined kubefed clusters

func JoinedClusterTotalInc

func JoinedClusterTotalInc()

JoinedClusterTotalInc increases by one the number of joined kubefed clusters

func ReconcileFederatedResourcesDurationFromStart

func ReconcileFederatedResourcesDurationFromStart(start time.Time)

ReconcileFederatedResourcesDurationFromStart records the duration of the federation of resources

func RegisterAll

func RegisterAll()

RegisterAll registers all metrics.

func RegisterKubefedClusterTotal

func RegisterKubefedClusterTotal(state, cluster string)

RegisterKubefedClusterTotal records number of kubefed clusters in a specific state

func UnjoinedClusterDurationFromStart

func UnjoinedClusterDurationFromStart(start time.Time)

UnjoinedClusterDurationFromStart records the duration of the cluster unjoined operation

func UpdateControllerReconcileDuration

func UpdateControllerReconcileDuration(controller string, duration time.Duration)

UpdateControllerReconcileDuration records the duration of the reconcile function of a controller

func UpdateControllerReconcileDurationFromStart

func UpdateControllerReconcileDurationFromStart(controller string, start time.Time)

UpdateControllerReconcileDurationFromStart records the duration of the reconcile loop of a controller

func UpdateControllerRuntimeReconcileTime added in v0.10.0

func UpdateControllerRuntimeReconcileTime(controller string, duration time.Duration)

UpdateControllerRuntimeReconcileTime records the duration of the reconcile function of a controller

func UpdateControllerRuntimeReconcileTimeFromStart added in v0.10.0

func UpdateControllerRuntimeReconcileTimeFromStart(controller string, start time.Time)

UpdateControllerRuntimeReconcileTimeFromStart records the duration of the reconcile loop of a controller

Types

This section is empty.

Jump to

Keyboard shortcuts

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