@contrast/scopes
v1.42.1
Published
Handles AsyncLocalStorage scopes
Keywords
Readme
@contrast/scopes
AsyncLocalStorage management for the Contrast Node.js agent. It provides two
stores on core.scopes:
core.scopes.sourcesholds the per-request store, so concurrent requests stay isolated.core.scopes.instrumentationcontrols whether agent instrumentation runs. Code run withinstrumentation.run({ lock: true, name }, fn)is locked, and instrumentation hooks checkinstrumentation.isLocked()and do nothing while it is.@contrast/deadzonesuses this to skip libraries the agent shouldn't track.
core.scopes.wrap(fn) returns a callback that runs in whichever of these stores
were active when it was wrapped.
