Skip to content

Commit

Permalink
Shorten metric names
Browse files Browse the repository at this point in the history
Signed-off-by: Marco Pracucci <[email protected]>
  • Loading branch information
pracucci committed Nov 12, 2020
1 parent d10bbce commit 880b4be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
10 changes: 5 additions & 5 deletions pkg/block/indexheader/lazy_binary_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,23 @@ type LazyBinaryReaderMetrics struct {
func NewLazyBinaryReaderMetrics(reg prometheus.Registerer) *LazyBinaryReaderMetrics {
return &LazyBinaryReaderMetrics{
loadCount: promauto.With(reg).NewCounter(prometheus.CounterOpts{
Name: "binary_reader_lazy_load_total",
Name: "indexheader_lazy_load_total",
Help: "Total number of index-header lazy load operations.",
}),
loadFailedCount: promauto.With(reg).NewCounter(prometheus.CounterOpts{
Name: "binary_reader_lazy_load_failed_total",
Name: "indexheader_lazy_load_failed_total",
Help: "Total number of failed index-header lazy load operations.",
}),
unloadCount: promauto.With(reg).NewCounter(prometheus.CounterOpts{
Name: "binary_reader_lazy_unload_total",
Name: "indexheader_lazy_unload_total",
Help: "Total number of index-header lazy unload operations.",
}),
unloadFailedCount: promauto.With(reg).NewCounter(prometheus.CounterOpts{
Name: "binary_reader_lazy_unload_failed_total",
Name: "indexheader_lazy_unload_failed_total",
Help: "Total number of failed index-header lazy unload operations.",
}),
loadDuration: promauto.With(reg).NewHistogram(prometheus.HistogramOpts{
Name: "binary_reader_lazy_load_duration_seconds",
Name: "indexheader_lazy_load_duration_seconds",
Help: "Duration of the index-header lazy loading in seconds.",
Buckets: []float64{0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5},
}),
Expand Down
3 changes: 1 addition & 2 deletions pkg/block/indexheader/reader_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/prometheus/prometheus/tsdb/index"
"go.uber.org/atomic"

"github.com/thanos-io/thanos/pkg/extprom"
"github.com/thanos-io/thanos/pkg/objstore"
)

Expand All @@ -38,7 +37,7 @@ func NewReaderPool(logger log.Logger, lazyReaderEnabled bool, lazyReaderIdleTime
logger: logger,
lazyReaderEnabled: lazyReaderEnabled,
lazyReaderIdleTimeout: lazyReaderIdleTimeout,
lazyReaderMetrics: NewLazyBinaryReaderMetrics(extprom.WrapRegistererWithPrefix("indexheader_pool_", reg)),
lazyReaderMetrics: NewLazyBinaryReaderMetrics(reg),
readers: make(map[*readerTracker]struct{}),
close: make(chan struct{}),
}
Expand Down

0 comments on commit 880b4be

Please sign in to comment.