feat: Add source mapping support to HeapProfiler#4122
Open
amychisholm03 wants to merge 2 commits into
Open
Conversation
amychisholm03
commented
Jul 9, 2026
|
|
||
| async collect() { | ||
| const profile = this.#pprof.heap.profile() | ||
| const profile = this.#pprof.heap.profile(undefined, this.sourceMapper) |
Contributor
Author
There was a problem hiding this comment.
This first parameter is ignoreSamplePath which we do not need, so it is always undefined.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4122 +/- ##
==========================================
- Coverage 97.48% 97.40% -0.09%
==========================================
Files 517 517
Lines 62270 62275 +5
Branches 1 1
==========================================
- Hits 60705 60657 -48
- Misses 1565 1618 +53
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
9c0b757 to
da42bee
Compare
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 PR adds source mapping support for our
HeapProfiler. This is done by passing in our sharedsourceMapperinstance intopprof.heap.profile(), which is called inHeapProfiler.collect(). Coordinating unit and integrations tests have been added.How to Test
Test Files
With the Example App
Example app: newrelic/newrelic-node-examples#378
With

heapprofiling enabled, and selecting "Objects" in the dropdown on the Profiling UI, you can see*.tsfiles listed instead of*.js(expected behavior with source mapping).Related Issues
Closes #4102