From 5e522c52d6ec1b8d13dad4031a236af4dc2e88d3 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 2765b4d4..ae094492 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