cyclops-ui/cyclops

Expose template cache metrics to prometheus

petar-cvit opened this issue · 0 comments

Is your feature request related to a problem? Please describe.
Cyclops controller fetches templates (helm charts) to render UIs and deploy applications. To improve the performance of template fetching, the controller uses an in-memory cache for templates.

The goal of the issue is to expose metrics from the template cache to the prometheus server and have them exposed on /metrics.

Describe the solution you'd like
Cache is defined here as ristretto.Cache and metrics are available in the Metrics field. Here is the Prometheus monitor where we should add new metrics for the templates cache and expose methods for updating metric values.

Cache metrics can be exposed each time a new cache request is initiated or periodically using a cronjob that runs in a separate goroutine.