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/indexgateway/metrics.go

37 lines
1.0 KiB

package indexgateway
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"github.com/grafana/loki/v3/pkg/util/constants"
)
const (
routeChunkRefs = "chunk_refs"
routeShards = "shards"
)
type Metrics struct {
preFilterChunks *prometheus.HistogramVec
postFilterChunks *prometheus.HistogramVec
}
func NewMetrics(r prometheus.Registerer) *Metrics {
return &Metrics{
preFilterChunks: promauto.With(r).NewHistogramVec(prometheus.HistogramOpts{
Namespace: constants.Loki,
Subsystem: "index_gateway",
Name: "prefilter_chunks",
Help: "Number of chunks before filtering",
Buckets: prometheus.ExponentialBuckets(1, 4, 10),
}, []string{"route"}),
postFilterChunks: promauto.With(r).NewHistogramVec(prometheus.HistogramOpts{
Namespace: constants.Loki,
Subsystem: "index_gateway",
Name: "postfilter_chunks",
Help: "Number of chunks after filtering",
Buckets: prometheus.ExponentialBuckets(1, 4, 10),
}, []string{"route"}),
}
}