diff --git a/commands/bake.go b/commands/bake.go index e9636e2f..f7dda3d5 100644 --- a/commands/bake.go +++ b/commands/bake.go @@ -38,6 +38,7 @@ import ( "github.com/pkg/errors" "github.com/spf13/cobra" "github.com/tonistiigi/go-csvvalue" + "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" ) @@ -64,7 +65,7 @@ type bakeOptions struct { } func runBake(ctx context.Context, dockerCli command.Cli, targets []string, in bakeOptions, cFlags commonFlags) (err error) { - mp := dockerCli.MeterProvider() + mp := otel.GetMeterProvider() ctx, end, err := tracing.TraceCurrentCommand(ctx, append([]string{"bake"}, targets...), attribute.String("builder", in.builder), diff --git a/commands/build.go b/commands/build.go index 7c902758..c6ad7028 100644 --- a/commands/build.go +++ b/commands/build.go @@ -59,6 +59,7 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/tonistiigi/go-csvvalue" + "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/metric" "google.golang.org/grpc/codes" @@ -282,7 +283,7 @@ func (o *buildOptionsHash) String() string { } func runBuild(ctx context.Context, dockerCli command.Cli, options buildOptions) (err error) { - mp := dockerCli.MeterProvider() + mp := otel.GetMeterProvider() ctx, end, err := tracing.TraceCurrentCommand(ctx, []string{"build", options.contextPath}, attribute.String("builder", options.builder),