Repository navigation
feat: async context labels - #334
Open
BadLiveware wants to merge 5 commits into
Open
BadLiveware wants to merge 5 commits into
BadLiveware wants to merge 5 commits into
Conversation
Use pprof's native scoped contexts to keep labels attached to overlapping asynchronous workloads without per-await JavaScript hooks. Enable this through wall.asyncContext or PYROSCOPE_WALL_ASYNC_CONTEXT, and reject unsupported runtimes instead of silently losing attribution. Preserve contexts across profile flushes, reject unscoped label mutation in async mode, and retain synchronous labeling by default. Return callback results with their inferred types and restore default-mode labels even when callbacks throw.
Keep activation and compatibility requirements next to the existing usage link instead of maintaining a separate SDK guide. The canonical usage documentation lives on the Pyroscope documentation site.
Create a fresh async frame before calling the native setter, which mutates the current frame's map in place. Existing sibling continuations retain their captured labels while setLabels persists within the current continuation. Keep default process-wide behavior unchanged. Exercise isolation, historical samples, flushes and restart through native node:test cases with test-managed cleanup.
Keep the contribution aligned with the existing test and tooling layout, which has no benchmark harness. Performance experiments remain local rather than adding a new maintained utility.
The generic wrapper inferred an empty argument tuple for callbacks without declared parameters, rejecting calls that previously accepted extra arguments even with async mode disabled. Retain the typed overload and restore the legacy call form through a compatibility overload. Verify argument forwarding and promise identity in both profiling modes.
BadLiveware
marked this pull request as ready for review
October 9, 2026 16:01
This branch has not been deployed
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.
Adds support for labels across async contexts. ~14% slower in a very await-heavy benchmark. Opt-in via config