From 7e369b9318a4d5d97a004586a99f10fa51a46b26 Mon Sep 17 00:00:00 2001 From: Mitsuhiro Tanda Date: Wed, 28 Dec 2016 03:34:07 +0900 Subject: [PATCH] expose max memory chunks metrics (#2303) * expose max memory chunks metrics --- storage/local/storage.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/storage/local/storage.go b/storage/local/storage.go index 8c9f54a4c..17f3e9d28 100644 --- a/storage/local/storage.go +++ b/storage/local/storage.go @@ -87,6 +87,11 @@ var ( "The maximum number of chunks that can be waiting for persistence before sample ingestion will stop.", nil, nil, ) + maxMemChunksDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, subsystem, "max_memory_chunks"), + "The configured maximum number of chunks that can be held in memory", + nil, nil, + ) ) type quarantineRequest struct { @@ -1763,6 +1768,11 @@ func (s *MemorySeriesStorage) Collect(ch chan<- prometheus.Metric) { ch <- s.ingestedSamplesCount s.discardedSamplesCount.Collect(ch) ch <- s.nonExistentSeriesMatchesCount + ch <- prometheus.MustNewConstMetric( + maxMemChunksDesc, + prometheus.GaugeValue, + float64(s.maxMemoryChunks), + ) ch <- prometheus.MustNewConstMetric( chunk.NumMemChunksDesc, prometheus.GaugeValue,