Documentation
¶
Index ¶
- type Metrics
- func (m *Metrics) Collect(ch chan<- prometheus.Metric)
- func (m *Metrics) Describe(ch chan<- *prometheus.Desc)
- func (m *Metrics) PersesInstances(namespace string) prometheus.Gauge
- func (m *Metrics) Ready(controller string) prometheus.Gauge
- func (m *Metrics) ReconcileErrors(controller, reason string) prometheus.Counter
- func (m *Metrics) ReconcileOperations(controller string) prometheus.Counter
- func (m *Metrics) SetFailedResources(objKey, resource string, v int)
- func (m *Metrics) SetSyncedResources(objKey, resource string, v int)
- type ReconciliationStatus
- type ReconciliationTracker
- func (rt *ReconciliationTracker) Collect(ch chan<- prometheus.Metric)
- func (rt *ReconciliationTracker) Describe(ch chan<- *prometheus.Desc)
- func (rt *ReconciliationTracker) ForgetObject(key string)
- func (rt *ReconciliationTracker) GetStatus(k string) (ReconciliationStatus, bool)
- func (rt *ReconciliationTracker) SetReasonAndMessage(key string, reason, message string)
- func (rt *ReconciliationTracker) SetStatus(key string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
Metrics represents metrics associated with the operator.
func NewMetrics ¶
func NewMetrics() *Metrics
NewMetrics initializes operator metrics and registers them with the controller-runtime registry.
func (*Metrics) Collect ¶
func (m *Metrics) Collect(ch chan<- prometheus.Metric)
Collect implements the prometheus.Collector interface.
func (*Metrics) Describe ¶
func (m *Metrics) Describe(ch chan<- *prometheus.Desc)
Describe implements the prometheus.Collector interface.
func (*Metrics) PersesInstances ¶
func (m *Metrics) PersesInstances(namespace string) prometheus.Gauge
PersesInstances returns a gauge to track Perses instance count.
func (*Metrics) Ready ¶
func (m *Metrics) Ready(controller string) prometheus.Gauge
Ready returns a gauge to track operator readiness for the given controller.
func (*Metrics) ReconcileErrors ¶
func (m *Metrics) ReconcileErrors(controller, reason string) prometheus.Counter
ReconcileErrors returns a counter to track reconciliation errors.
func (*Metrics) ReconcileOperations ¶
func (m *Metrics) ReconcileOperations(controller string) prometheus.Counter
ReconcileOperations returns a counter to track total reconciliation operations.
func (*Metrics) SetFailedResources ¶
SetFailedResources sets the number of resources that failed to sync for the given object's key.
func (*Metrics) SetSyncedResources ¶
SetSyncedResources sets the number of resources that synced successfully for the given object's key.
type ReconciliationStatus ¶
type ReconciliationStatus struct {
// contains filtered or unexported fields
}
ReconciliationStatus represents the status of a reconciliation operation.
func (ReconciliationStatus) Message ¶
func (rs ReconciliationStatus) Message() string
Message returns the reconciliation message.
func (ReconciliationStatus) Ok ¶
func (rs ReconciliationStatus) Ok() bool
Ok returns true if the reconciliation was successful.
func (ReconciliationStatus) Reason ¶
func (rs ReconciliationStatus) Reason() string
Reason returns the reconciliation reason.
type ReconciliationTracker ¶
type ReconciliationTracker struct {
// contains filtered or unexported fields
}
ReconciliationTracker tracks reconciliation status per object.
It uses the namespace/name key to identify objects.
func NewReconciliationTracker ¶
func NewReconciliationTracker(reg prometheus.Registerer) *ReconciliationTracker
NewReconciliationTracker creates a new ReconciliationTracker and registers it with the metrics registry.
func (*ReconciliationTracker) Collect ¶
func (rt *ReconciliationTracker) Collect(ch chan<- prometheus.Metric)
Collect implements the prometheus.Collector interface.
func (*ReconciliationTracker) Describe ¶
func (rt *ReconciliationTracker) Describe(ch chan<- *prometheus.Desc)
Describe implements the prometheus.Collector interface.
func (*ReconciliationTracker) ForgetObject ¶
func (rt *ReconciliationTracker) ForgetObject(key string)
ForgetObject removes the given object from the tracker. It should be called when the controller detects that the object has been deleted.
func (*ReconciliationTracker) GetStatus ¶
func (rt *ReconciliationTracker) GetStatus(k string) (ReconciliationStatus, bool)
GetStatus returns the last reconciliation status for the given object. The second value indicates whether the object is known or not.
func (*ReconciliationTracker) SetReasonAndMessage ¶
func (rt *ReconciliationTracker) SetReasonAndMessage(key string, reason, message string)
SetReasonAndMessage updates the reason and message for the object identified by key. The reason and message are only used when the reconciliation returned no error.
func (*ReconciliationTracker) SetStatus ¶
func (rt *ReconciliationTracker) SetStatus(key string, err error)
SetStatus updates the last reconciliation status for the object identified by key.