Skip to content

Commit 6413915

Browse files
Merge pull request #527 from stevekuznetsov/skuznets/pprof-package-server-manager
OCPBUGS-17157: cmd/package-server-manager: add pprof endpoints
2 parents d5108bd + 5b2fedd commit 6413915

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

cmd/package-server-manager/main.go

+6
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const (
2828
defaultNamespace = "openshift-operator-lifecycle-manager"
2929
defaultMetricsPort = "0"
3030
defaultHealthCheckPort = ":8080"
31+
defaultPprofPort = ":6060"
3132
leaderElectionConfigmapName = "packageserver-controller-lock"
3233
)
3334

@@ -57,6 +58,10 @@ func run(cmd *cobra.Command, args []string) error {
5758
if err != nil {
5859
return err
5960
}
61+
pprofAddr, err := cmd.Flags().GetString("pprof")
62+
if err != nil {
63+
return err
64+
}
6065

6166
ctrl.SetLogger(zap.New(zap.UseDevMode(true)))
6267
setupLog := ctrl.Log.WithName("setup")
@@ -76,6 +81,7 @@ func run(cmd *cobra.Command, args []string) error {
7681
RenewDeadline: &le.RenewDeadline.Duration,
7782
RetryPeriod: &le.RetryPeriod.Duration,
7883
HealthProbeBindAddress: healthCheckAddr,
84+
PprofBindAddress: pprofAddr,
7985
Cache: cache.Options{
8086
ByObject: map[client.Object]cache.ByObject{
8187
&olmv1alpha1.ClusterServiceVersion{}: {

cmd/package-server-manager/start.go

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ func newStartCmd() *cobra.Command {
1515
cmd.Flags().String("name", defaultName, "configures the metadata.name for the packageserver csv resource")
1616
cmd.Flags().String("namespace", defaultNamespace, "configures the metadata.namespace that contains the packageserver csv resource")
1717
cmd.Flags().String("health", defaultHealthCheckPort, "configures the health check port that the kubelet is configured to probe")
18+
cmd.Flags().String("pprof", defaultPprofPort, "configures the pprof port that the process exposes")
1819
cmd.Flags().Bool("disable-leader-election", false, "configures whether leader election will be disabled")
1920

2021
return cmd

0 commit comments

Comments
 (0)