🚀 Big News:Socket Has Acquired Secure Annex.Learn More
Socket
Book a DemoSign in
Socket

@opentelemetry/context-async-hooks

Package Overview
Dependencies
Maintainers
4
Versions
138
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentelemetry/context-async-hooks

OpenTelemetry AsyncLocalStorage-based Context Manager

latest
Source
npmnpm
Version
2.7.1
Version published
Weekly downloads
30M
0.27%
Maintainers
4
Weekly downloads
 
Created
Source

OpenTelemetry async_hooks-based Context Managers

NPM Published Version Apache License

This package provides two ContextManager implementations built on APIs from Node.js's [async_hooks][async-hooks-doc] module. If you're looking for a ContextManager to use in browser environments, consider opentelemetry-context-zone or opentelemetry-context-zone-peer-dep.

See the definition of the ContextManager interface and the problem it solves.

API

Two ContextManager implementations are exported:

  • AsyncLocalStorageContextManager, based on AsyncLocalStorage
  • AsyncHooksContextManager, based on AsyncHook. This is deprecated and will be removed in v3 (planned for mid-2025. AsyncLocalStorage is simpler, faster, available in Node.js v14.8.0 and later, and avoids this possible DoS vulnerability.

Prior art

Context propagation is a big subject when talking about tracing in Node.js. If you want more information about it here are some resources:

License

Apache 2.0 - See LICENSE for more information.

Keywords

opentelemetry

FAQs

Package last updated on 29 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts