Skip to content

Commit

Permalink
ROX-27244: serve pprof server with fleetshard-sync (#2117)
Browse files Browse the repository at this point in the history
serve pprof server with fleetshard-sync
  • Loading branch information
johannes94 authored Dec 4, 2024
1 parent c4b135c commit d7bf50a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions fleetshard/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@ 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"
"github.com/stackrox/acs-fleet-manager/fleetshard/pkg/fleetshardmetrics"
"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"
)
Expand Down Expand Up @@ -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...)
Expand Down

0 comments on commit d7bf50a

Please sign in to comment.