From d9bc4f739564667871245e963ea819f9695fa7fc Mon Sep 17 00:00:00 2001 From: owensmallwood Date: Wed, 23 Oct 2024 01:35:17 -0600 Subject: [PATCH] Search poc: Add debug log for metric and update metric buckets (#95217) * adds debug log for metric * updates buckets --- pkg/storage/unified/resource/index.go | 4 +++- pkg/storage/unified/resource/index_metrics.go | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/storage/unified/resource/index.go b/pkg/storage/unified/resource/index.go index 7d57c4818bf..64d0296c6a0 100644 --- a/pkg/storage/unified/resource/index.go +++ b/pkg/storage/unified/resource/index.go @@ -53,7 +53,7 @@ func (i *Index) IndexBatch(list *ListResponse, kind string) error { if err != nil { return err } - i.log.Debug("initial indexing resources batch", "count", len(list.Items), "kind", kind, "tenant", res.Namespace) + i.log.Debug("indexing resource in batch", "batch_count", len(list.Items), "kind", kind, "tenant", res.Namespace) // Transform the raw resource into a more generic indexable resource indexableResource, err := NewIndexedResource(obj.Value) @@ -88,6 +88,7 @@ func (i *Index) Init(ctx context.Context) error { // Paginate through the list of resources and index each page for { + i.log.Debug("fetching resource list", "kind", rt.Key.Resource) list, err := i.s.List(ctx, r) if err != nil { return err @@ -108,6 +109,7 @@ func (i *Index) Init(ctx context.Context) error { } end := time.Now().Unix() + i.log.Debug("Initial indexing finished", "seconds", float64(end-start)) if IndexServerMetrics != nil { IndexServerMetrics.IndexCreationTime.WithLabelValues().Observe(float64(end - start)) } diff --git a/pkg/storage/unified/resource/index_metrics.go b/pkg/storage/unified/resource/index_metrics.go index e379459ff2a..103c2bddb7b 100644 --- a/pkg/storage/unified/resource/index_metrics.go +++ b/pkg/storage/unified/resource/index_metrics.go @@ -26,7 +26,7 @@ type IndexMetrics struct { IndexCreationTime *prometheus.HistogramVec } -var IndexCreationBuckets = []float64{1, 5, 10, 25, 50, 75, 100, 150, 200, 250, 300} +var IndexCreationBuckets = []float64{1, 5, 10, 25, 50, 75, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000} func NewIndexMetrics(indexDir string, indexServer *IndexServer) *IndexMetrics { onceIndex.Do(func() {