Documentation ¶
Overview ¶
Package metrics contains a Recorder and helpers for recoding standard metrics for all GitOps Toolkit components.
Index ¶
- Constants
- type Recorder
- func (r *Recorder) Collectors() []prometheus.Collector
- func (r *Recorder) RecordCondition(ref corev1.ObjectReference, condition metav1.Condition, deleted bool)
- func (r *Recorder) RecordDuration(ref corev1.ObjectReference, start time.Time)
- func (r *Recorder) RecordSuspend(ref corev1.ObjectReference, suspend bool)
Constants ¶
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.