metrics

package
v0.44.1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 5 Imported by: 24

Documentation

Overview

Package metrics contains a Recorder and helpers for recoding standard metrics for all GitOps Toolkit components.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Recorder

type Recorder struct {
	// contains filtered or unexported fields
}

Recorder is a struct for recording GitOps Toolkit metrics for a controller.

Use NewRecorder to initialise it with properly configured metric names.

func MustMakeRecorder added in v0.42.0

func MustMakeRecorder() *Recorder

MustMakeRecorder attempts to register the metrics collectors in the controller-runtime metrics registry, which panics upon the first registration that causes an error. Which usually happens if you try to initialise a Metrics value twice for your controller.

func NewRecorder

func NewRecorder() *Recorder

NewRecorder returns a new Recorder with all metric names configured confirm GitOps Toolkit standards.

func (*Recorder) Collectors

func (r *Recorder) Collectors() []prometheus.Collector

Collectors returns a slice of Prometheus collectors, which can be used to register them in a metrics registry.

func (*Recorder) DeleteCondition added in v0.42.0

func (r *Recorder) DeleteCondition(ref corev1.ObjectReference, conditionType string)

DeleteCondition deletes the condition metrics for the ref.

func (*Recorder) DeleteDuration added in v0.42.0

func (r *Recorder) DeleteDuration(ref corev1.ObjectReference)

DeleteDuration deletes the duration metric for the ref.

func (*Recorder) DeleteSuspend added in v0.42.0

func (r *Recorder) DeleteSuspend(ref corev1.ObjectReference)

DeleteSuspend deletes the suspend metric for the ref.

func (*Recorder) RecordCondition

func (r *Recorder) RecordCondition(ref corev1.ObjectReference, condition metav1.Condition)

RecordCondition records the condition as given for the ref.

func (*Recorder) RecordDuration

func (r *Recorder) RecordDuration(ref corev1.ObjectReference, start time.Time)

RecordDuration records the duration since start for the given ref.

func (*Recorder) RecordSuspend added in v0.5.0

func (r *Recorder) RecordSuspend(ref corev1.ObjectReference, suspend bool)

RecordSuspend records the suspend status as given for the ref.

Jump to

Keyboard shortcuts

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