Repository navigation
feat: expose opt-in pprof via PPROF_BIND_ADDRESS [RHIDP-15222] - #4249
Conversation
PR Summary by QodoAdd opt-in pprof server via PPROF_BIND_ADDRESS env var
AI Description
Merge Risk
|
|
Important The |
|
✅ PR images built and pushed successfully! Images are available for testing (expires in 7 days):
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4249 +/- ##
==========================================
+ Coverage 60.55% 65.08% +4.52%
==========================================
Files 52 52
Lines 3684 3282 -402
==========================================
- Hits 2231 2136 -95
+ Misses 1257 1146 -111
+ Partials 196 0 -196
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Diagnostic analysis from testing:Verified on pod rhdh-operator-67f75fc787-7gcv8, image quay.io/rhdh-community/operator:2.2.0-pr-4249-64e57a3, with PPROF_BIND_ADDRESS=127.0.0.1:6060. /proc/net/tcp shows 0100007F:17AC in state 0A. That is 127.0.0.1:6060 listening. 8081 and 8443 are unchanged. No Service or Route was added for 6060. Port-forward from the laptop, then: The
|
|
✅ PR images built and pushed successfully! Images are available for testing (expires in 7 days):
|
OpinionatedHeron
left a comment
There was a problem hiding this comment.
Overall, I think you have something pretty solid here. Just a few callouts.
Before committing this, I think the ReadMe needs to be updated with this change as per the best_practices.md, as a new enablement is being added to the repo. I think the admin doc is a good place to start - is should show the restart requirements and details about the new configuration.
Co-authored-by: Leanne Ahern <127859485+OpinionatedHeron@users.noreply.github.com>
Co-authored-by: Leanne Ahern <127859485+OpinionatedHeron@users.noreply.github.com>
|
❌ PR image build failed See workflow run for details. |
|
✅ PR images built and pushed successfully! Images are available for testing (expires in 7 days):
|
|
✅ PR images built and pushed successfully! Images are available for testing (expires in 7 days):
|
|
✅ PR images built and pushed successfully! Images are available for testing (expires in 7 days):
|
|
✅ PR images built and pushed successfully! Images are available for testing (expires in 7 days):
|
|
|
✅ PR images built and pushed successfully! Images are available for testing (expires in 7 days):
|
|
Everything looks good to me, happy to merge. /lgtm |



Summary
Work in progress, enabling pprof via PPROF_BIND_ADDRESS to accessible for the rhdh-operator.
RHIDP-15222 makes the operator serve Go pprof when an admin opts in.
cmd/main.goreadsPPROF_BIND_ADDRESSat process start and passes it to controller-runtime. Unset or empty leaves pprof off, which is the production default. The value to enable it is127.0.0.1:6060.The Deployment, CSV, Service, and Route stay unchanged. No Service or Route is added for 6060. The operator image still has no
curlorwget. A new pod is required after the variable changes, because controller-runtime reads the address only at startup. On an OLM install the variable has to be set on the CSV.oc set envon the Deployment is reverted.Must-gather does not change here. The handoff for RHIDP-15223 is: label
app=rhdh-operator, Deploymentrhdh-operator, containermanager, port-forward to 6060, thenGET /debug/pprof/heapandGET /debug/pprof/allocs. The response is a Go pprof protobuf.Evidence
rhdh-operator-86795b94d4-fr5s6hadPPROF_BIND_ADDRESS=127.0.0.1:6060and still listened only on 8081 and 8443./manager --helphas no pprof flag.curlandwgetare not in the image.PprofBindAddress. Still to show on a build of this commit: with the variable unset, nothing listens on 6060; with127.0.0.1:6060,curl http://127.0.0.1:6060/debug/pprof/heapfrom outside the pod returns a profile thatgo tool pprof -topcan open. The same check for/debug/pprof/allocs.Merge Danger
Door: two-way
The default install does not set the variable, so merging does not open a port. Reverting the commit removes the option.
Blast radius: operator pod, and only after someone sets
PPROF_BIND_ADDRESSand the pod restarts. A value of:6060listens on every interface.127.0.0.1:6060stays on the pod loopback.