From ee5505476b176ff0c9837cafa58d8fa41e64f5b6 Mon Sep 17 00:00:00 2001 From: Brian Ginsburg Date: Mon, 18 Nov 2024 14:28:31 -0800 Subject: [PATCH] chore: Add report deal metrics trace errors --- pkg/solver/controller.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/solver/controller.go b/pkg/solver/controller.go index c7de7be9..fba1b6e8 100644 --- a/pkg/solver/controller.go +++ b/pkg/solver/controller.go @@ -307,9 +307,15 @@ func (controller *SolverController) solve(ctx context.Context) error { span.AddEvent("report_deal_metrics.start") storedDeals, err := controller.store.GetDealsAll() if err != nil { + span.SetStatus(codes.Error, "get all deals failed") + span.RecordError(err) return err } - reportDealMetrics(ctx, controller.meter, storedDeals) + err = reportDealMetrics(ctx, controller.meter, storedDeals) + if err != nil { + span.SetStatus(codes.Error, "report deal metrics failed") + span.RecordError(err) + } span.AddEvent("report_deal_metrics.done") return nil