package imgcache import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" ) // The counts of what the image cache does, kept in memory as Prometheus // counters. They are registered on Prometheus' default registry, which // /metrics serves. Adding to one waits for nothing and makes no database // call. Each counts for the whole process since it started. // //nolint:gochecknoglobals // Prometheus registers each counter once per process var ( cacheHits = promauto.NewCounter(prometheus.CounterOpts{ Name: "pixa_cache_hits_total", Help: "Image requests served from the cache.", }) cacheMisses = promauto.NewCounter(prometheus.CounterOpts{ Name: "pixa_cache_misses_total", Help: "Image requests not served from the cache.", }) upstreamFetches = promauto.NewCounter(prometheus.CounterOpts{ Name: "pixa_upstream_fetches_total", Help: "Fetches of a source image from upstream that read any bytes.", }) upstreamFetchBytes = promauto.NewCounter(prometheus.CounterOpts{ Name: "pixa_upstream_fetch_bytes_total", Help: "Bytes read from upstream by fetches of source images.", }) transforms = promauto.NewCounter(prometheus.CounterOpts{ Name: "pixa_transforms_total", Help: "Images the image processor transformed.", }) )