[WIP] feat: add endpoint to dump heap allocation profile#3497
Draft
albertlockett wants to merge 3 commits into
Draft
[WIP] feat: add endpoint to dump heap allocation profile#3497albertlockett wants to merge 3 commits into
albertlockett wants to merge 3 commits into
Conversation
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (10.20%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #3497 +/- ##
==========================================
- Coverage 86.26% 86.23% -0.03%
==========================================
Files 753 754 +1
Lines 295599 296460 +861
==========================================
+ Hits 254985 255650 +665
- Misses 40090 40286 +196
Partials 524 524
🚀 New features to boost your workflow:
|
Pull request dashboard statusStatus last refreshed: 2026-07-22 19:57:37 UTC.
This automated status or its linked feedback items may be incorrect. If something looks wrong, please report it with the result you expected. |
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.
Status: DRAFT
Outstanding:
Change Summary
Adds an endpoint (/api/v1/debug/pprof/heap) that can dump the a profile (in pprof format) heap allocations.
Further reading about this solution: https://www.polarsignals.com/blog/posts/2023/12/20/rust-memory-profiling
Run the app w/ profiling enabled.
jemallocmust be the allocator (default on linux and macos):_RJEM_MALLOC_CONF="prof:true,prof_active:true,lg_prof_sample:19" \ cargo run -- \ --config ./configs/trafficgen-filter-debug-noop.yamlscrape the endpoint, open in your favourite pprof viewer
This endpoint will return 500 when:
profilingfeatureprof:true,prof_active:trueare not setWhat issue does this PR close?
How are these changes tested?
Manually
Are there any user-facing changes?
Yes, the user could call this endpoint
Changelog
.chloggen/*.yamlentrychore(indicated in title)