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 <cpuguy83@gmail.com>
pull/812/head
Brian Goff 3 years ago
parent 084b6c0a95
commit b6474d43a9

@ -217,8 +217,7 @@ func resolveDrivers(ctx context.Context, drivers []DriverInfo, auth Auth, opt ma
} }
err = eg.Wait() err = eg.Wait()
span.RecordError(err) tracing.FinishWithError(span, err)
span.End()
if err != nil { if err != nil {
return nil, nil, err 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) { eg.Go(func() (err error) {
defer func() { defer func() {
if span != nil { if span != nil {
span.RecordError(err) tracing.FinishWithError(span, err)
span.End()
} }
}() }()
pw := progress.WithPrefix(w, "default", false) pw := progress.WithPrefix(w, "default", false)

Loading…
Cancel
Save