Skip to content

feat(gitter): Add memory profiling support via pprof#4821

Draft
another-rex wants to merge 3 commits intomasterfrom
gitter-memory-profiling-12702934846432634660
Draft

feat(gitter): Add memory profiling support via pprof#4821
another-rex wants to merge 3 commits intomasterfrom
gitter-memory-profiling-12702934846432634660

Conversation

@another-rex
Copy link
Contributor

Added memory profiling support to the gitter service.

Changes:

  • Modified go/cmd/gitter/gitter.go:
    • Imported net/http/pprof.
    • Added --profile_port flag.
    • Setup a separate HTTP server for profiling if the port is specified.
    • Use http.NewServeMux() for the main application to avoid exposing pprof on the main port.
  • Updated deployment/clouddeploy/gke-workers/base/gitter.yaml:
    • Added --profile_port=6060 argument.
    • Exposed port 6060 in the Service.
  • Updated deployment/clouddeploy/gke-workers/environments/oss-vdb/gitter.yaml and oss-vdb-test/gitter.yaml:
    • Added --profile_port=6060 argument (since args are replaced in overlays).

Verification:

  • Ran go test ./... in go/cmd/gitter (passed).
  • Verified locally by running gitter with --profile_port and checking localhost:6060/debug/pprof/ and the main endpoint.

PR created automatically by Jules for task 12702934846432634660 started by @another-rex

- 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>
@google-labs-jules
Copy link
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

google-labs-jules bot and others added 2 commits February 17, 2026 05:41
- 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>
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.

1 participant