Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCPBUGS-17157: cmd/package-server-manager: add pprof endpoints #527

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cmd/package-server-manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const (
defaultNamespace = "openshift-operator-lifecycle-manager"
defaultMetricsPort = "0"
defaultHealthCheckPort = ":8080"
defaultPprofPort = ":6060"
leaderElectionConfigmapName = "packageserver-controller-lock"
)

Expand Down Expand Up @@ -57,6 +58,10 @@ func run(cmd *cobra.Command, args []string) error {
if err != nil {
return err
}
pprofAddr, err := cmd.Flags().GetString("pprof")
if err != nil {
return err
}

ctrl.SetLogger(zap.New(zap.UseDevMode(true)))
setupLog := ctrl.Log.WithName("setup")
Expand All @@ -76,6 +81,7 @@ func run(cmd *cobra.Command, args []string) error {
RenewDeadline: &le.RenewDeadline.Duration,
RetryPeriod: &le.RetryPeriod.Duration,
HealthProbeBindAddress: healthCheckAddr,
PprofBindAddress: pprofAddr,
Cache: cache.Options{
ByObject: map[client.Object]cache.ByObject{
&olmv1alpha1.ClusterServiceVersion{}: {
Expand Down
1 change: 1 addition & 0 deletions cmd/package-server-manager/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ func newStartCmd() *cobra.Command {
cmd.Flags().String("name", defaultName, "configures the metadata.name for the packageserver csv resource")
cmd.Flags().String("namespace", defaultNamespace, "configures the metadata.namespace that contains the packageserver csv resource")
cmd.Flags().String("health", defaultHealthCheckPort, "configures the health check port that the kubelet is configured to probe")
cmd.Flags().String("pprof", defaultPprofPort, "configures the pprof port that the process exposes")
cmd.Flags().Bool("disable-leader-election", false, "configures whether leader election will be disabled")

return cmd
Expand Down