CHORE: Enable pprof based on env var#114
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds an opt-in runtime profiling endpoint to the Heimdall HTTP server and runs a dependency tidy/update in Go modules to support the change and refresh transitive deps.
Changes:
- Add
/debug/pprof/endpoint, enabled only whenENABLE_DEBUG=true. - Update
go.mod/go.sumdependency set (adds/updates several indirect deps and adjusts AWS SDK service deps).
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| internal/pkg/heimdall/heimdall.go | Adds conditional registration of the /debug/pprof/ endpoint. |
| go.mod | Updates module requirements (including adding/updating profiling-related and AWS SDK dependencies). |
| go.sum | Updates dependency checksums to match go.mod changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Nitin Bhakar (nitinbhakar)
approved these changes
Jul 1, 2026
Yash Shrivastava (alephys26)
approved these changes
Jul 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request updates dependencies in
go.modand adds a new debug profiling endpoint to the Heimdall service. The most important changes are grouped below:Enable /debug/pprof/ endpoint based on env flag
Why
It would be useful for debugging certain stacktraces whenever required
Overheads added
CPU profiling (/debug/pprof/profile)
Sampling frequency 100 Hz (every 10ms per OS thread)
Overhead while active ~1–2% CPU (typical), up to ~5% on very high-throughput services
Memory / heap profiling (/debug/pprof/heap, /allocs)
Sampling rate 1 sample per 512 KB allocated (MemProfileRate, default)
Continuous overhead ~1–2% allocation-path cost — already present in every Go binary, pprof adds nothing
Goroutine profile (/debug/pprof/goroutine)
For ~1,000 goroutines < 1 ms STW pause
For ~10,000 ~1–10 ms STW pause
Execution trace (/debug/pprof/trace)
Overhead while active ~10–20% (can spike higher on scheduler-heavy workloads)