feat(gitter): Add memory profiling support via pprof#4821
feat(gitter): Add memory profiling support via pprof#4821another-rex wants to merge 3 commits intomasterfrom
Conversation
- Add `--profile_port` flag to gitter to enable a separate HTTP server for pprof. - Refactor main server to use a custom ServeMux to isolate app handlers. - Update Kubernetes deployments to expose the profiling port (6060). Co-authored-by: another-rex <106129829+another-rex@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
- Add `--profile_port` flag to gitter to enable a separate HTTP server for pprof. - Refactor main server to use a custom ServeMux to isolate app handlers. - Update Kubernetes deployments to expose the profiling port (6060). - Suppress gosec warning G108 for pprof import. Co-authored-by: another-rex <106129829+another-rex@users.noreply.github.com>
- Add `--enable_profiling` boolean flag to gitter to enable pprof endpoints on the main port. - Use `net/http/pprof` directly to register handlers conditionally, avoiding global side effects and linter issues. - Update Kubernetes deployments to enable profiling. Co-authored-by: another-rex <106129829+another-rex@users.noreply.github.com>
Added memory profiling support to the gitter service.
Changes:
go/cmd/gitter/gitter.go:net/http/pprof.--profile_portflag.http.NewServeMux()for the main application to avoid exposing pprof on the main port.deployment/clouddeploy/gke-workers/base/gitter.yaml:--profile_port=6060argument.deployment/clouddeploy/gke-workers/environments/oss-vdb/gitter.yamlandoss-vdb-test/gitter.yaml:--profile_port=6060argument (sinceargsare replaced in overlays).Verification:
go test ./...ingo/cmd/gitter(passed).gitterwith--profile_portand checkinglocalhost:6060/debug/pprof/and the main endpoint.PR created automatically by Jules for task 12702934846432634660 started by @another-rex