From d7bf50addc25447c61f9232180ef491b4f4cc100 Mon Sep 17 00:00:00 2001 From: Johannes Malsam <60240743+johannes94@users.noreply.github.com> Date: Wed, 4 Dec 2024 20:20:02 +0100 Subject: [PATCH] ROX-27244: serve pprof server with fleetshard-sync (#2117) serve pprof server with fleetshard-sync --- fleetshard/main.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/fleetshard/main.go b/fleetshard/main.go index 343937929..1c9056cea 100644 --- a/fleetshard/main.go +++ b/fleetshard/main.go @@ -4,13 +4,14 @@ package main import ( "context" "flag" + "os" + "os/signal" + "time" + "github.com/stackrox/acs-fleet-manager/fleetshard/pkg/central/reconciler" "github.com/stackrox/acs-fleet-manager/internal/certmonitor" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/informers" - "os" - "os/signal" - "time" "github.com/golang/glog" "github.com/stackrox/acs-fleet-manager/fleetshard/config" @@ -18,6 +19,7 @@ import ( "github.com/stackrox/acs-fleet-manager/fleetshard/pkg/k8s" "github.com/stackrox/acs-fleet-manager/fleetshard/pkg/runtime" "github.com/stackrox/acs-fleet-manager/pkg/logger" + "github.com/stackrox/acs-fleet-manager/pkg/server/profiler" "golang.org/x/sys/unix" ctrl "sigs.k8s.io/controller-runtime" ) @@ -150,6 +152,10 @@ func main() { } }() + pprofServer := profiler.SingletonPprofServer() + pprofServer.Start() + defer pprofServer.Stop() + sigs := make(chan os.Signal, 1) notifySignals := []os.Signal{os.Interrupt, unix.SIGTERM} signal.Notify(sigs, notifySignals...)