Search: improve logging in case of failed dashboard loading phase (#55523)

This commit is contained in:
Artur Wierzbicki 2022-09-20 23:50:29 +02:00 committed by GitHub
parent 57a0b6db2c
commit 9db2720016
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)