From 3303eb78817a8f5640a20c7ba1f94d6807ca56e9 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Tue, 20 Sep 2022 18:08:21 -0400 Subject: [PATCH] Search: improve logging in case of failed dashboard loading phase (#55523) (#55524) (cherry picked from commit 9db272001639f7c68848827909372875846c8f9c) Co-authored-by: Artur Wierzbicki --- pkg/services/searchV2/index.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/services/searchV2/index.go b/pkg/services/searchV2/index.go index d099453834c..4a7e9209b6e 100644 --- a/pkg/services/searchV2/index.go +++ b/pkg/services/searchV2/index.go @@ -444,10 +444,11 @@ func (i *searchIndex) buildOrgIndex(ctx context.Context, orgID int64) (int, erro i.logger.Info("Start building org index", "orgId", orgID) dashboards, err := i.loader.LoadDashboards(ctx, orgID, "") - if err != nil { - return 0, fmt.Errorf("error loading dashboards: %w", err) - } orgSearchIndexLoadTime := time.Since(started) + + if err != nil { + return 0, fmt.Errorf("error loading dashboards: %w, elapsed: %s", err, orgSearchIndexLoadTime.String()) + } i.logger.Info("Finish loading org dashboards", "elapsed", orgSearchIndexLoadTime, "orgId", orgID) dashboardExtender := i.extender.GetDashboardExtender(orgID)