diff --git a/cmd/core/app/server.go b/cmd/core/app/server.go index 59ccc58ee..044fe2b53 100644 --- a/cmd/core/app/server.go +++ b/cmd/core/app/server.go @@ -86,9 +86,6 @@ the core control loops shipped with KubeVela`, for _, set := range namedFlagSets.FlagSets { fs.AddFlagSet(set) } - if s.PprofAddr != "" { - go pkgutil.EnablePprof(s.PprofAddr, nil) - } meta.Name = types.VelaCoreName klog.InfoS("KubeVela information", "version", version.VelaVersion, "revision", version.GitRevision) @@ -114,6 +111,10 @@ func run(ctx context.Context, s *options.CoreOptions) error { "Burst", restConfig.Burst, ) + if s.PprofAddr != "" { + go pkgutil.EnablePprof(s.PprofAddr, nil) + } + // wrapper the round tripper by multi cluster rewriter if s.EnableClusterGateway { client, err := multicluster.Initialize(restConfig, true)