From 20cba1ed8fcc9d849f0057d59d3398ee0cff969d Mon Sep 17 00:00:00 2001 From: beorn7 Date: Mon, 25 Apr 2016 17:08:07 +0200 Subject: [PATCH] Initialize metric vectors in memorySeriesStorage --- storage/local/storage.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/storage/local/storage.go b/storage/local/storage.go index 4d980feea..3561db5b4 100644 --- a/storage/local/storage.go +++ b/storage/local/storage.go @@ -279,6 +279,25 @@ func NewMemorySeriesStorage(o *MemorySeriesStorageOptions) Storage { Help: "1 if the storage is in rushed mode, 0 otherwise. In rushed mode, the system behaves as if the persistence_urgency_score is 1.", }), } + + // Initialize metric vectors. + // TODO(beorn7): Rework once we have a utility function for it in golang_client. + s.discardedSamplesCount.WithLabelValues(outOfOrderTimestamp) + s.discardedSamplesCount.WithLabelValues(duplicateSample) + s.maintainSeriesDuration.WithLabelValues(maintainInMemory) + s.maintainSeriesDuration.WithLabelValues(maintainArchived) + s.seriesOps.WithLabelValues(create) + s.seriesOps.WithLabelValues(archive) + s.seriesOps.WithLabelValues(unarchive) + s.seriesOps.WithLabelValues(memoryPurge) + s.seriesOps.WithLabelValues(archivePurge) + s.seriesOps.WithLabelValues(requestedPurge) + s.seriesOps.WithLabelValues(memoryMaintenance) + s.seriesOps.WithLabelValues(archiveMaintenance) + s.seriesOps.WithLabelValues(completedQurantine) + s.seriesOps.WithLabelValues(droppedQuarantine) + s.seriesOps.WithLabelValues(failedQuarantine) + return s }