(r prometheus.Registerer)
| 45 | } |
| 46 | |
| 47 | func NewPostingCacheMetrics(r prometheus.Registerer) *ExpandedPostingsCacheMetrics { |
| 48 | return &ExpandedPostingsCacheMetrics{ |
| 49 | CacheRequests: promauto.With(r).NewCounterVec(prometheus.CounterOpts{ |
| 50 | Name: "cortex_ingester_expanded_postings_cache_requests_total", |
| 51 | Help: "Total number of requests to the cache.", |
| 52 | }, []string{"cache"}), |
| 53 | CacheHits: promauto.With(r).NewCounterVec(prometheus.CounterOpts{ |
| 54 | Name: "cortex_ingester_expanded_postings_cache_hits_total", |
| 55 | Help: "Total number of hit requests to the cache.", |
| 56 | }, []string{"cache"}), |
| 57 | CacheMiss: promauto.With(r).NewCounterVec(prometheus.CounterOpts{ |
| 58 | Name: "cortex_ingester_expanded_postings_cache_miss_total", |
| 59 | Help: "Total number of miss requests to the cache.", |
| 60 | }, []string{"cache", "reason"}), |
| 61 | CacheEvicts: promauto.With(r).NewCounterVec(prometheus.CounterOpts{ |
| 62 | Name: "cortex_ingester_expanded_postings_cache_evicts_total", |
| 63 | Help: "Total number of evictions in the cache, excluding items that got evicted due to TTL.", |
| 64 | }, []string{"cache", "reason"}), |
| 65 | NonCacheableQueries: promauto.With(r).NewCounterVec(prometheus.CounterOpts{ |
| 66 | Name: "cortex_ingester_expanded_postings_non_cacheable_queries_total", |
| 67 | Help: "Total number of non cacheable queries.", |
| 68 | }, []string{"cache"}), |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | type TSDBPostingsCacheConfig struct { |
| 73 | Head PostingsCacheConfig `yaml:"head" doc:"description=If enabled, ingesters will cache expanded postings for the head block. Only queries with with an equal matcher for metric __name__ are cached."` |
no outgoing calls