metrics

package
v0.6.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ReceivingMetricsFromOperator is used to test if metric collection works.
	ReceivingMetricsFromOperator = prometheus.NewCounter(
		prometheus.CounterOpts{
			Name: "receiving_metrics_from_operator",
			Help: "Value is 1, if you are able to receive custom metrics from the operator",
		},
	)
)

Functions

func GetWebhookRequestCount

func GetWebhookRequestCount(wt utils.WebhookType, obj runtime.Object) int

GetWebhookRequestCount gets the request count for the given webhook type and target object.

func GetWebhookRequestPanicCountWith

func GetWebhookRequestPanicCountWith(wt utils.WebhookType, obj runtime.Object) int

GetWebhookRequestPanicCountWith gets the request panic count for the given webhook type and target object.

func GetWebhookRequestPassCount

func GetWebhookRequestPassCount(wt utils.WebhookType, obj runtime.Object) int

GetWebhookRequestPassCount gets the request pass count for the given webhook type and target object.

func GetWebhookRequestRejectCount

func GetWebhookRequestRejectCount(wt utils.WebhookType, obj runtime.Object) int

GetWebhookRequestRejectCount gets the request reject count for the given webhook type and target object.

func IncControllerReconcileCount

func IncControllerReconcileCount(target types.NamespacedName, gvk schema.GroupVersionKind)

IncControllerReconcileCount increases reconcile count of the given object by 1.

func IncControllerReconcilePanicCount

func IncControllerReconcilePanicCount(target types.NamespacedName, gvk schema.GroupVersionKind)

IncControllerReconcilePanicCount increases reconcile panic count of the given object by 1.

func IncControllerReconcileRequeueCount

func IncControllerReconcileRequeueCount(target types.NamespacedName, gvk schema.GroupVersionKind)

IncControllerReconcileRequeueCount increases reconcile requeue count of the given object by 1.

func IncControllerReconcileRequeueErrorCount

func IncControllerReconcileRequeueErrorCount(target types.NamespacedName, gvk schema.GroupVersionKind)

IncControllerReconcileRequeueErrorCount increases reconcile error count of the given object by 1.

func IncWebhookRequestCount

func IncWebhookRequestCount(wt utils.WebhookType, obj runtime.Object)

IncWebhookRequestCount increases the request count for the given webhook type and target object by 1.

func IncWebhookRequestPanicCount

func IncWebhookRequestPanicCount(wt utils.WebhookType, obj runtime.Object)

IncWebhookRequestPanicCount increases the request panic count for the given webhook type and target object by 1.

func IncWebhookRequestPassCount

func IncWebhookRequestPassCount(wt utils.WebhookType, obj runtime.Object)

IncWebhookRequestPassCount increases the request pass count for the given webhook type and target object by 1.

func IncWebhookRequestRejectCount

func IncWebhookRequestRejectCount(wt utils.WebhookType, obj runtime.Object)

IncWebhookRequestRejectCount increases the request reject count for the given webhook type and target object by 1.

func InitMetrics

func InitMetrics()

InitMetrics registers custom metrics with the global prometheus registry.

func NewControllerMetricsRecorder

func NewControllerMetricsRecorder(r reconcile.Reconciler, name string, gvk schema.GroupVersionKind) reconcile.Reconciler

NewControllerMetricsRecorder returns a new ControllerMetricsRecorder.

func NewMutatingWebhookMetricsRecorder

func NewMutatingWebhookMetricsRecorder(inner webhook.CustomDefaulter) webhook.CustomDefaulter

NewMutatingWebhookMetricsRecorder creates a new metrics recorder for the mutating webhook.

func NewValidatingWebhookMetricsRecorder

func NewValidatingWebhookMetricsRecorder(inner webhook.CustomValidator) webhook.CustomValidator

NewValidatingWebhookMetricsRecorder creates a new webhook recorder for validating webhook.

func ResetMetrics

func ResetMetrics()

ResetMetrics resets all metrics. Use for testing only.

func UpdateControllerReconcileDuration

func UpdateControllerReconcileDuration(timeInMilliSeconds int64, gvk schema.GroupVersionKind, webhookName string, target types.NamespacedName)

UpdateControllerReconcileDuration updates reconcile duration histogram with the give time for the given object and webhook.

func UpdateControllerReconcileRequeueAfter

func UpdateControllerReconcileRequeueAfter(timeInMilliSecond int64, target types.NamespacedName, gvk schema.GroupVersionKind)

UpdateControllerReconcileRequeueAfter updates reconcile requeue after histogram with the give time for the given object.

Types

This section is empty.

Jump to

Keyboard shortcuts

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