Skip to content

Commit

Permalink
expose max memory chunks metrics (prometheus#2303)
Browse files Browse the repository at this point in the history
* expose max memory chunks metrics
  • Loading branch information
mtanda authored and brian-brazil committed Dec 27, 2016
1 parent 93b70ee commit 7e369b9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions storage/local/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 7e369b9

Please sign in to comment.