From 4e0045a937910c2483bd37241f347e9a56ab8df0 Mon Sep 17 00:00:00 2001 From: Jonathan Halterman Date: Fri, 15 Nov 2024 09:07:30 -0800 Subject: [PATCH] Log querier bucket index updates (#9912) Adds logging of querier bucket index updates so we can inspect exactly which bucket index version/timestamp a particular querier is working off of. --- pkg/storage/tsdb/bucketindex/loader.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/storage/tsdb/bucketindex/loader.go b/pkg/storage/tsdb/bucketindex/loader.go index 225b69a037f..e3909187a49 100644 --- a/pkg/storage/tsdb/bucketindex/loader.go +++ b/pkg/storage/tsdb/bucketindex/loader.go @@ -208,6 +208,12 @@ func (l *Loader) updateCachedIndex(ctx context.Context, userID string) { // is when a tenant has rules configured but hasn't started remote writing yet. Rules will be evaluated and // bucket index loaded by the ruler. l.indexesMx.Lock() + userIdx := l.indexes[userID] + if idx != nil { + if userIdx == nil || (userIdx.index != nil && userIdx.index.UpdatedAt != idx.UpdatedAt) { + level.Debug(l.logger).Log("msg", "loaded bucket index", "user", userID, "updatedAt", idx.UpdatedAt) + } + } l.indexes[userID].index = idx l.indexes[userID].err = err l.indexes[userID].setUpdatedAt(startTime)