statemetrics

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: Apache-2.0 Imports: 12 Imported by: 441

Documentation

Overview

Package statemetrics contains utilities for recording Crossplane resource state metrics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MRStateMetrics

type MRStateMetrics struct {
	Exists *prometheus.GaugeVec
	Ready  *prometheus.GaugeVec
	Synced *prometheus.GaugeVec
}

MRStateMetrics holds Prometheus metrics for managed resources.

func NewMRStateMetrics

func NewMRStateMetrics() *MRStateMetrics

NewMRStateMetrics returns a new MRStateMetrics.

func (*MRStateMetrics) Collect

func (r *MRStateMetrics) Collect(ch chan<- prometheus.Metric)

Collect is called by the Prometheus registry when collecting metrics. The implementation sends each collected metric via the provided channel and returns once the last metric has been sent.

func (*MRStateMetrics) Describe

func (r *MRStateMetrics) Describe(ch chan<- *prometheus.Desc)

Describe sends the super-set of all possible descriptors of metrics collected by this Collector to the provided channel and returns once the last descriptor has been sent.

type MRStateRecorder

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

A MRStateRecorder records the state of managed resources.

func NewMRStateRecorder

func NewMRStateRecorder(c client.Client, log logging.Logger, metrics *MRStateMetrics, managedList resource.ManagedList, interval time.Duration) *MRStateRecorder

NewMRStateRecorder returns a new MRStateRecorder which records the state of managed resources.

func (*MRStateRecorder) Record

func (r *MRStateRecorder) Record(ctx context.Context) error

Record records the state of managed resources.

func (*MRStateRecorder) Start

func (r *MRStateRecorder) Start(ctx context.Context) error

Start records state of managed resources with given interval.

type NopStateRecorder

type NopStateRecorder struct{}

A NopStateRecorder does nothing.

func NewNopStateRecorder

func NewNopStateRecorder() *NopStateRecorder

NewNopStateRecorder returns a NopStateRecorder that does nothing.

func (*NopStateRecorder) Record

Record does nothing.

func (*NopStateRecorder) Start

func (r *NopStateRecorder) Start(_ context.Context) error

Start does nothing.

type StateRecorder

type StateRecorder interface {
	Record(ctx context.Context, gvk schema.GroupVersionKind)
	Start(ctx context.Context) error
}

A StateRecorder records the state of given GroupVersionKind.

Jump to

Keyboard shortcuts

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