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

[feature request] Support golang runtime or net/http pprof #1225

Closed
gaocegege opened this issue Nov 26, 2019 · 4 comments
Closed

[feature request] Support golang runtime or net/http pprof #1225

gaocegege opened this issue Nov 26, 2019 · 4 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@gaocegege
Copy link

/kind feature

It will be nice if we could support net/http/pprof or runtime/pprof with kubebuilder.

Now I have such a workaround:

func main() {
	ctrl.SetLogger(zap.Logger(true))

	var metricsAddr string
	var pprofAddr string
	var enableLeaderElection bool
	flag.StringVar(&pprofAddr, "pprof-addr", "0", "The address the pprof endpoint binds to.")
	flag.StringVar(&metricsAddr, "metrics-addr", "0", "The address the metric endpoint binds to.")
	flag.BoolVar(&enableLeaderElection, "enable-leader-election", false,
		"Enable leader election for controller manager. Enabling this will ensure there is only one active controller manager.")

	flag.Parse()


	if pprofAddr != "0" {
		go func() {
			log.Println(http.ListenAndServe(pprofAddr, nil))
		}()
	}

I think we can reuse the metrics-addr for pprof but now it is running on TCP, thus it cannot work with http pprof.

@gaocegege gaocegege added the kind/feature Categorizes issue or PR as related to a new feature. label Nov 26, 2019
@yeya24
Copy link

yeya24 commented Feb 15, 2020

I am running into the same issue. Seems there is a PR for this now kubernetes-sigs/controller-runtime#743.

@camilamacedo86
Copy link
Member

Kubebuilder uses the controller-runtime so it is something that would need to be implemented/provided there and then, will be available to kubebuilder when it is using the release version with the solution. Also, as @yeya24 point out shows that we have a PR already for that there.

@yeya24 @gaocegege could you please follow up this PR and raise this need in kubernetes-sigs/controller-runtime ?

I am closing this one since shows that has nothing to be done here. However, please feel free to re-open if I misunderstood something or if you think that it needs to be kept open because something still needs to be done in the Kubebuilder project.

/close

@k8s-ci-robot
Copy link
Contributor

@camilamacedo86: Closing this issue.

In response to this:

Kubebuilder uses the controller-runtime so it is something that would need to be implemented/provided there and then, will be available to kubebuilder when it is using the release version with the solution. Also, as @yeya24 point out shows that we have a PR already for that there.

@yeya24 @gaocegege could you please follow up this PR and raise this need in kubernetes-sigs/controller-runtime ?

I am closing this one since shows that has nothing to be done here. However, please feel free to re-open if I misunderstood something or if you think that it needs to be kept open because something still needs to be done in the Kubebuilder project.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@gaocegege
Copy link
Author

SGTM. Thanks for your reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

4 participants