Documentation
¶
Index ¶
Constants ¶
const ( OperatorConfigMapName = "ocs-client-operator-config" DefaultPollInterval = 1 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector exposes alerts fetched from the storage provider as Prometheus metrics. Each firing provider-side alert becomes a gauge:
ocs_client_alert{alert_name="X", severity="Y", storage_client="Z", ...} = value
The "alertname" key from the provider labels is renamed to "alert_name" to avoid conflicting with Prometheus' reserved alertname label.
Describe sends no descriptors so the collector is registered as "unchecked", which allows dynamic label sets per alert.
func NewCollector ¶
NewCollector creates a collector that reads from ca's in-memory alert cache.
func (*Collector) Collect ¶
func (c *Collector) Collect(ch chan<- prometheus.Metric)
Collect implements prometheus.Collector.
func (*Collector) Describe ¶
func (c *Collector) Describe(chan<- *prometheus.Desc)
Describe implements prometheus.Collector. Empty on purpose -- signals an unchecked collector to the registry because label names vary per alert.
type ResourceCollector ¶
type ResourceCollector struct {
// contains filtered or unexported fields
}
ResourceCollector exposes resource counts and upgrade status as Prometheus metrics. It reads from the controller-runtime cache (cached client) during each Prometheus scrape, so no background polling loop is needed.
func NewResourceCollector ¶
func NewResourceCollector(c client.Client, operatorNamespace string) *ResourceCollector
NewResourceCollector creates a collector that counts CephFS PVs, ODF VolumeGroupSnapshotContent resources, and checks upgrade status.
func (*ResourceCollector) Collect ¶
func (c *ResourceCollector) Collect(ch chan<- prometheus.Metric)
Collect implements prometheus.Collector.
func (*ResourceCollector) Describe ¶
func (c *ResourceCollector) Describe(chan<- *prometheus.Desc)
Describe implements prometheus.Collector. Empty on purpose -- unchecked collector.
type Runnable ¶
Runnable is a manager.Runnable that periodically fetches firing alerts from the storage provider for each connected StorageClient.
func NewRunnable ¶
func NewRunnable(c client.Client, namespace string, logger logr.Logger, pollInterval time.Duration) *Runnable
NewRunnable creates a new alert Runnable.
func (*Runnable) GetAllAlerts ¶
GetAllAlerts returns all currently cached alerts keyed by StorageClient name.
func (*Runnable) GetPollInterval ¶
GetPollInterval atomically reads the poll interval.
func (*Runnable) SetPollInterval ¶
SetPollInterval atomically updates the poll interval.