From f35dae3726782940921eeadb1d1104fd245a132b Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Wed, 16 Oct 2024 20:54:34 -0700 Subject: [PATCH] build: add OTEL span around build function Signed-off-by: Tonis Tiigi --- build/build.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/build.go b/build/build.go index 2ebf0898..8e1a9c19 100644 --- a/build/build.go +++ b/build/build.go @@ -500,7 +500,9 @@ func BuildWithResultHandler(ctx context.Context, nodes []builder.Node, opts map[ resultHandle, rr, err = NewResultHandle(ctx, cc, *so, "buildx", buildFunc, ch) resultHandleFunc(dp.driverIndex, resultHandle) } else { + span, ctx := tracing.StartSpan(ctx, "build") rr, err = c.Build(ctx, *so, "buildx", buildFunc, ch) + tracing.FinishWithError(span, err) } if !so.Internal && desktop.BuildBackendEnabled() && node.Driver.HistoryAPISupported(ctx) { if err != nil {