Skip to content

chore(context-async-hooks): Deprecate AsyncHooksContextManager#6298

Merged
pichlermarc merged 2 commits intoopen-telemetry:mainfrom
trentm:trentm-deprecate-async-hooks-createHook
Jan 15, 2026
Merged

chore(context-async-hooks): Deprecate AsyncHooksContextManager#6298
pichlermarc merged 2 commits intoopen-telemetry:mainfrom
trentm:trentm-deprecate-async-hooks-createHook

Conversation

@trentm
Copy link
Copy Markdown
Contributor

@trentm trentm commented Jan 14, 2026

AsyncLocalStorageContextManager is a better context manager to use in
all cases for Node.js 14.8.0 and later, and the current min supported
Node.js is v18. AsyncLocalStorageContextManager is already used by
default in NodeSDK setup.

A recent indirect DoS vulnerability involving AsyncHook and stack
overflow is the motivation for finally deprecating this class.
https://nodejs.org/en/blog/vulnerability/january-2026-dos-mitigation-async-hooks

The plan is to remove this in OTel JS SDK v3 (planned for mid-2026).

AsyncLocalStorageContextManager is a better context manager to use in
all cases for Node.js 14.8.0 and later, and the current min supported
Node.js is v18. AsyncLocalStorageContextManager is already used by
default in NodeSDK setup.

A recent indirect DoS vulnerability involving AsyncHook and stack
overflow is the motivation for finally deprecating this class.
https://nodejs.org/en/blog/vulnerability/january-2026-dos-mitigation-async-hooks

The plan is to remove this in OTel JS SDK v3 (planned for mid-2025).
@trentm trentm self-assigned this Jan 14, 2026
@trentm trentm requested a review from a team as a code owner January 14, 2026 22:54
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.39%. Comparing base (118f5b5) to head (4cec5a3).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6298   +/-   ##
=======================================
  Coverage   95.39%   95.39%           
=======================================
  Files         316      316           
  Lines        9574     9574           
  Branches     2216     2216           
=======================================
  Hits         9133     9133           
  Misses        441      441           
Files with missing lines Coverage Δ
...ontext-async-hooks/src/AsyncHooksContextManager.ts 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pichlermarc pichlermarc added this pull request to the merge queue Jan 15, 2026
Merged via the queue into open-telemetry:main with commit bbb87eb Jan 15, 2026
27 checks passed
@trentm trentm deleted the trentm-deprecate-async-hooks-createHook branch January 15, 2026 19:59
maryliag pushed a commit to maryliag/opentelemetry-js that referenced this pull request Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants