Like Prometheus, but for logs.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
loki/pkg/pattern/aggregation/metrics.go

28 lines
846 B

package aggregation
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
type ChunkMetrics struct {
chunks *prometheus.GaugeVec
samples *prometheus.CounterVec
}
func NewChunkMetrics(r prometheus.Registerer, metricsNamespace string) *ChunkMetrics {
return &ChunkMetrics{
chunks: promauto.With(r).NewGaugeVec(prometheus.GaugeOpts{
Namespace: metricsNamespace,
Subsystem: "pattern_ingester",
Name: "metric_chunks",
Help: "The total number of chunks in memory.",
}, []string{"service_name"}),
samples: promauto.With(r).NewCounterVec(prometheus.CounterOpts{
Namespace: metricsNamespace,
Subsystem: "pattern_ingester",
Name: "metric_samples",
Help: "The total number of samples in memory.",
}, []string{"service_name"}),
}
}