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

fix: avoid to use http.DefaultServeMux which includes defaults routes inited by go like /debug/pprof #1771

Merged
merged 1 commit into from
Nov 30, 2024

Conversation

morlay
Copy link
Contributor

@morlay morlay commented Nov 26, 2024

https://cs.opensource.google/go/go/+/refs/tags/go1.23.3:src/net/http/pprof/pprof.go;l=100

metrics may just metrics

if enable pprof in metrics server, the flags --enable-pprof may be confused.

Copy link
Collaborator

@aauren aauren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -260,13 +260,15 @@ func (mc *Controller) Run(healthChan chan<- *healthcheck.ControllerHeartbeat, st
DefaultRegisterer.MustRegister(BuildInfo)
DefaultRegisterer.MustRegister(ControllerIpvsMetricsExportTime)

mux := &http.ServeMux{}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nit here, can you change this to http.NewServeMux() instead? It amounts to the same, but seems better to use the default function provided.

@morlay
Copy link
Contributor Author

morlay commented Nov 29, 2024

updated.

Copy link
Collaborator

@aauren aauren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks for the contribution! 🙂

@aauren aauren merged commit 6db096d into cloudnativelabs:master Nov 30, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants