cyclops icon indicating copy to clipboard operation
cyclops copied to clipboard

๐Ÿš€feat(cyclops-ctrl): adds prometheus metrics to reconciler

Open naineel1209 opened this issue 4 months ago โ€ข 2 comments

closes #598

๐Ÿ“‘ Description

  • added required reconciler metrics to the Prometheus monitor
  • currently added metrics are
type Monitor struct {
	ModulesDeployed  prometheus.Gauge
	CacheHits        prometheus.Gauge
	CacheMisses      prometheus.Gauge
	CacheKeysAdded   prometheus.Gauge
	CacheCostAdded   prometheus.Gauge
	CacheKeysEvicted prometheus.Gauge
	CacheCostEvicted prometheus.Gauge

	// Reconciler Metrics
	ReconcilerDuration   prometheus.Histogram
	NoOfReconciliations   prometheus.Counter
	FailedReconciliations prometheus.Counter
}
  • added methods to update the reconciler metrics
  • added increment for no_of_reconciliations for every attempted reconciliation
  • added increment for failed_reconciliations for every failed reconciliation
  • added deferred function call to observe the amount of time spent in reconciliation

โœ… Checks

  • [โœ…] I have tested my code (provide screenshots or screen recordings of a working solution)
  • [โœ…] I have performed a self-review of my code

โ„น Additional context

naineel1209 avatar Oct 04 '24 17:10 naineel1209