metrics

package
v0.16.2 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: Apache-2.0 Imports: 4 Imported by: 24

Documentation

Overview

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

Index

Constants

View Source
const (
	ConditionDeleted = "Deleted"
)

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 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) RecordCondition

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

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