From b6474d43a902c0f0756b889f88c9a2c227b71a5c Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Thu, 21 Oct 2021 22:24:51 +0000 Subject: [PATCH] Mark span status as error when fatal error occurs. Before this only recorded errors instead of setting the span status, which makes it harder to dig through. Now an error that bubbles is reflected in the span status. Signed-off-by: Brian Goff --- build/build.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/build/build.go b/build/build.go index 1bdbddbd..f94bc9b6 100644 --- a/build/build.go +++ b/build/build.go @@ -217,8 +217,7 @@ func resolveDrivers(ctx context.Context, drivers []DriverInfo, auth Auth, opt ma } err = eg.Wait() - span.RecordError(err) - span.End() + tracing.FinishWithError(span, err) if err != nil { return nil, nil, err } @@ -684,8 +683,7 @@ func Build(ctx context.Context, drivers []DriverInfo, opt map[string]Options, do eg.Go(func() (err error) { defer func() { if span != nil { - span.RecordError(err) - span.End() + tracing.FinishWithError(span, err) } }() pw := progress.WithPrefix(w, "default", false)