flux_utils

package
v2.24.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

type Metrics struct {
	Scheme          *runtime.Scheme
	MetricsRecorder *metrics.Recorder
}

Metrics is a helper struct that adds the capability for recording GitOps Toolkit standard metrics to a reconciler.

Use it by embedding it in your reconciler struct:

	type MyTypeReconciler {
 	client.Client
     // ... etc.
     controller.Metrics
	}

Following the GitOps Toolkit conventions, API types used in GOTK SHOULD implement conditions.Getter to work with status condition types, and this convention MUST be followed to be able to record metrics using this helper.

Use MustMakeMetrics to create a working Metrics value; you can supply the same value to all reconcilers.

Once initialised, metrics can be recorded by calling one of the available `Record*` methods.

func (Metrics) RecordCondition

func (m Metrics) RecordCondition(ctx context.Context, obj conditions.Getter, conditionType string)

RecordCondition records the status of the given conditionType for the given obj.

func (Metrics) RecordDuration

func (m Metrics) RecordDuration(ctx context.Context, obj conditions.Getter, startTime time.Time)

RecordDuration records the duration of a reconcile attempt for the given obj based on the given startTime.

func (Metrics) RecordReadiness

func (m Metrics) RecordReadiness(ctx context.Context, obj conditions.Getter)

RecordReadiness records the flux_utils.ReadyCondition status for the given obj.

func (Metrics) RecordReconciling

func (m Metrics) RecordReconciling(ctx context.Context, obj conditions.Getter)

RecordReconciling records the flux_utils.ReconcilingCondition status for the given obj.

func (Metrics) RecordStalled

func (m Metrics) RecordStalled(ctx context.Context, obj conditions.Getter)

RecordStalled records the flux_utils.StalledCondition status for the given obj.

func (Metrics) RecordSuspend

func (m Metrics) RecordSuspend(ctx context.Context, obj conditions.Getter, suspend bool)

RecordSuspend records the suspension of the given obj based on the given suspend value.

Directories

Path Synopsis
Package conditions provides utilities for manipulating the status conditions of Kubernetes resource objects that implement the Getter and/or Setter interfaces.
Package conditions provides utilities for manipulating the status conditions of Kubernetes resource objects that implement the Getter and/or Setter interfaces.
Package metrics contains a Recorder and helpers for recoding standard metrics for all GitOps Toolkit components.
Package metrics contains a Recorder and helpers for recoding standard metrics for all GitOps Toolkit components.

Jump to

Keyboard shortcuts

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