From 9db272001639f7c68848827909372875846c8f9c Mon Sep 17 00:00:00 2001 From: Artur Wierzbicki Date: Tue, 20 Sep 2022 23:50:29 +0200 Subject: [PATCH] Search: improve logging in case of failed dashboard loading phase (#55523) --- 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 fa91635b0c2..b6a61f39308 100644 --- a/pkg/services/searchV2/index.go +++ b/pkg/services/searchV2/index.go @@ -461,10 +461,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)