diff --git a/pkg/ingester/flush.go b/pkg/ingester/flush.go index 370c86ec4dcf..2620c1cfbac1 100644 --- a/pkg/ingester/flush.go +++ b/pkg/ingester/flush.go @@ -23,47 +23,56 @@ import ( var ( chunkUtilization = promauto.NewHistogram(prometheus.HistogramOpts{ - Name: "loki_ingester_chunk_utilization", - Help: "Distribution of stored chunk utilization (when stored).", - Buckets: prometheus.LinearBuckets(0, 0.2, 6), + Namespace: "loki", + Name: "ingester_chunk_utilization", + Help: "Distribution of stored chunk utilization (when stored).", + Buckets: prometheus.LinearBuckets(0, 0.2, 6), }) memoryChunks = promauto.NewGauge(prometheus.GaugeOpts{ - Name: "loki_ingester_memory_chunks", - Help: "The total number of chunks in memory.", + Namespace: "loki", + Name: "ingester_memory_chunks", + Help: "The total number of chunks in memory.", }) chunkEntries = promauto.NewHistogram(prometheus.HistogramOpts{ - Name: "loki_ingester_chunk_entries", - Help: "Distribution of stored lines per chunk (when stored).", - Buckets: prometheus.ExponentialBuckets(200, 2, 9), // biggest bucket is 200*2^(9-1) = 51200 + Namespace: "loki", + Name: "ingester_chunk_entries", + Help: "Distribution of stored lines per chunk (when stored).", + Buckets: prometheus.ExponentialBuckets(200, 2, 9), // biggest bucket is 200*2^(9-1) = 51200 }) chunkSize = promauto.NewHistogram(prometheus.HistogramOpts{ - Name: "loki_ingester_chunk_size_bytes", - Help: "Distribution of stored chunk sizes (when stored).", - Buckets: prometheus.ExponentialBuckets(10000, 2, 7), // biggest bucket is 10000*2^(7-1) = 640000 (~640KB) + Namespace: "loki", + Name: "ingester_chunk_size_bytes", + Help: "Distribution of stored chunk sizes (when stored).", + Buckets: prometheus.ExponentialBuckets(10000, 2, 7), // biggest bucket is 10000*2^(7-1) = 640000 (~640KB) }) chunkCompressionRatio = promauto.NewHistogram(prometheus.HistogramOpts{ - Name: "loki_ingester_chunk_compression_ratio", - Help: "Compression ratio of chunks (when stored).", - Buckets: prometheus.LinearBuckets(.75, 2, 10), + Namespace: "loki", + Name: "ingester_chunk_compression_ratio", + Help: "Compression ratio of chunks (when stored).", + Buckets: prometheus.LinearBuckets(.75, 2, 10), }) chunksPerTenant = promauto.NewCounterVec(prometheus.CounterOpts{ - Name: "loki_ingester_chunks_stored_total", - Help: "Total stored chunks per tenant.", + Namespace: "loki", + Name: "ingester_chunks_stored_total", + Help: "Total stored chunks per tenant.", }, []string{"tenant"}) chunkSizePerTenant = promauto.NewCounterVec(prometheus.CounterOpts{ - Name: "loki_ingester_chunk_stored_bytes_total", - Help: "Total bytes stored in chunks per tenant.", + Namespace: "loki", + Name: "ingester_chunk_stored_bytes_total", + Help: "Total bytes stored in chunks per tenant.", }, []string{"tenant"}) chunkAge = promauto.NewHistogram(prometheus.HistogramOpts{ - Name: "loki_ingester_chunk_age_seconds", - Help: "Distribution of chunk ages (when stored).", + Namespace: "loki", + Name: "ingester_chunk_age_seconds", + Help: "Distribution of chunk ages (when stored).", // with default settings chunks should flush between 5 min and 12 hours // so buckets at 1min, 5min, 10min, 30min, 1hr, 2hr, 4hr, 10hr, 12hr, 16hr Buckets: []float64{60, 300, 600, 1800, 3600, 7200, 14400, 36000, 43200, 57600}, }) chunkEncodeTime = promauto.NewHistogram(prometheus.HistogramOpts{ - Name: "loki_ingester_chunk_encode_time_seconds", - Help: "Distribution of chunk encode times.", + Namespace: "loki", + Name: "ingester_chunk_encode_time_seconds", + Help: "Distribution of chunk encode times.", // 10ms to 10s. Buckets: prometheus.ExponentialBuckets(0.01, 4, 6), }) diff --git a/pkg/ingester/instance.go b/pkg/ingester/instance.go index a10fe6e9a4e2..5a465d5377b5 100644 --- a/pkg/ingester/instance.go +++ b/pkg/ingester/instance.go @@ -33,8 +33,9 @@ var ( var ( memoryStreams = promauto.NewGauge(prometheus.GaugeOpts{ - Name: "loki_ingester_memory_streams", - Help: "The total number of streams in memory.", + Namespace: "loki", + Name: "ingester_memory_streams", + Help: "The total number of streams in memory.", }) streamsCreatedTotal = promauto.NewCounterVec(prometheus.CounterOpts{ Namespace: "loki", diff --git a/pkg/ingester/transfer.go b/pkg/ingester/transfer.go index 7b9a66370feb..2c4093984b86 100644 --- a/pkg/ingester/transfer.go +++ b/pkg/ingester/transfer.go @@ -21,12 +21,14 @@ import ( var ( sentChunks = promauto.NewCounter(prometheus.CounterOpts{ - Name: "loki_ingester_sent_chunks", - Help: "The total number of chunks sent by this ingester whilst leaving.", + Namespace: "loki", + Name: "ingester_sent_chunks", + Help: "The total number of chunks sent by this ingester whilst leaving.", }) receivedChunks = promauto.NewCounter(prometheus.CounterOpts{ - Name: "loki_ingester_received_chunks", - Help: "The total number of chunks received by this ingester whilst joining.", + Namespace: "loki", + Name: "ingester_received_chunks", + Help: "The total number of chunks received by this ingester whilst joining.", }) ) diff --git a/pkg/util/validation/validate.go b/pkg/util/validation/validate.go index b86eae76d74b..8c59fdc828c5 100644 --- a/pkg/util/validation/validate.go +++ b/pkg/util/validation/validate.go @@ -13,8 +13,9 @@ const ( // DiscardedBytes is a metric of the total discarded bytes, by reason. var DiscardedBytes = prometheus.NewCounterVec( prometheus.CounterOpts{ - Name: "loki_discarded_bytes_total", - Help: "The total number of bytes that were discarded.", + Namespace: "loki", + Name: "discarded_bytes_total", + Help: "The total number of bytes that were discarded.", }, []string{discardReasonLabel, "tenant"}, ) @@ -22,8 +23,9 @@ var DiscardedBytes = prometheus.NewCounterVec( // DiscardedSamples is a metric of the number of discarded samples, by reason. var DiscardedSamples = prometheus.NewCounterVec( prometheus.CounterOpts{ - Name: "loki_discarded_samples_total", - Help: "The total number of samples that were discarded.", + Namespace: "loki", + Name: "discarded_samples_total", + Help: "The total number of samples that were discarded.", }, []string{discardReasonLabel, "tenant"}, )