{"name":"@opentelemetry/context-async-hooks","version":"0.8.0","description":"OpenTelemetry AsyncHooks-based Context Manager","main":"build/src/index.js","types":"build/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/open-telemetry/opentelemetry-js.git"},"scripts":{"test":"nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'","tdd":"npm run test -- --watch-extensions ts --watch","codecov":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../","clean":"rimraf build/*","lint":"gts check","lint:fix":"gts fix","precompile":"tsc --version","version:update":"node ../../scripts/version-update.js","compile":"npm run version:update && tsc -p .","prepare":"npm run compile"},"keywords":["opentelemetry","nodejs","tracing","profiling","metrics","stats"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","engines":{"node":">=8.0.0"},"publishConfig":{"access":"public"},"devDependencies":{"@types/mocha":"^7.0.0","@types/node":"^12.6.8","@types/shimmer":"^1.0.1","codecov":"^3.6.1","gts":"^1.1.0","mocha":"^6.1.0","nyc":"^15.0.0","rimraf":"^3.0.0","ts-mocha":"^6.0.0","ts-node":"^8.6.2","tslint-consistent-codestyle":"^1.16.0","tslint-microsoft-contrib":"^6.2.0","typescript":"3.7.2"},"dependencies":{"@opentelemetry/context-base":"^0.8.0"},"bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"homepage":"https://github.com/open-telemetry/opentelemetry-js#readme","_id":"@opentelemetry/context-async-hooks@0.8.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.1","_npmUser":{"name":"mayurkale22","email":"mayurkale22@gmail.com"},"dist":{"integrity":"sha512-xGsb/6wcM717lVqkvzAolaOTLG5ho+aajeRr53+F2Q7h+2RP29IRHpo9LQWc7aQ8pirCp1X33OwfWB7q148+Tw==","shasum":"2eca1bdda62931f02f9e5162d5dd658cacf89733","tarball":"http://registry-npm.ywwl.com/@opentelemetry/context-async-hooks/download/@opentelemetry/context-async-hooks-0.8.0.tgz","fileCount":9,"unpackedSize":31537,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeutBzCRA9TVsSAnZWagAAepYP/3+TAxYgatDhjOLpU/AX\n8AjqBj/zfiZ+Z8TDN7n8d66yjnlYO0DH2KbPP82SPoKZ28AdmM52Av47URUM\nFHbZWfGQH4yruQdaknpd5PMqoh4fxHllcbx0vBAJivHom0I/rLQsH8QQSgfd\nuGSRQCY76AwX/xO1UJCAV5T/mqwVpnPDbmf4uc+9exFTqj++b8sZiA6fmYXA\n29iHNvzFnUaGMF11MImWwd5YfHl6CdTSQ2v8iyKmcNlz0nD8YTb71OSuTD+o\nStgbj4LAKGU0K9Gk9+Dx+qdaAyFboUCTKLJkmDoal+CMSrg6Ar1XcjnfsiFl\nPugkciW1eJVVg42fF2JppspWeuDAfvLWjhh3/xGaCE5KDhdgNitbMhiAaqwD\niSq1zZlzFgYR3Lf1yEhKHpDrX75yxkk6FjQSN0iklNUgHr44MSgIrN6C/3wn\nLACEqwQ7/SOAZhxYCebQihycUXbsqq9pjQ5nCCBvjA1+yarNaLrX8vp1JL7x\nSDxPjraLNcWDLIySfaqs4CaSaAOFLeMKQd3alhdpv1OuvHuA1FGB5TSH9o60\nnR7/f/o7YwLV6ELAfvrrMdmRB/58zOaqeNRoh9rCmfhamhERJppq8flucoZB\nztj3l8EMMDiKuB928bDTsTGvVNVCLxdINawMceVYvQXUf1yGFbQ6gV80Up2q\nC0RX\r\n=CIFD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPuKmujBnelt7WZXC0r5hlotTxUHtRHBVYRthoi4vEfAIhAN+NKiN/YLE2PoH+Bh3y4mOV+HGtPzj0xZkmsWnpTF+7"}],"size":8532,"noattachment":false,"key":"/@opentelemetry/context-async-hooks/-/@opentelemetry/context-async-hooks-0.8.0.tgz"},"maintainers":[{"name":"bg451","email":"brandon.gonzalez.451@gmail.com"},{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dkhan","email":"daniel@khan.io"},{"name":"dyladan","email":"dyladan@gmail.com"},{"name":"mayurkale22","email":"mayurkale22@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/context-async-hooks_0.8.0_1589301362766_0.07986442342758493"},"_hasShrinkwrap":false,"readme":"# OpenTelemetry async_hooks-based Context Managers\n\n[![NPM Published Version][npm-img]][npm-url]\n[![Apache License][license-image]][license-image]\n\nThis package provides two [`ContextManager`](https://open-telemetry.github.io/opentelemetry-js/interfaces/_opentelemetry_api.ContextManager.html) 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](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-context-zone) or [opentelemetry-context-zone-peer-dep](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-context-zone-peer-dep).\n\nThe definition of the `ContextManager` interface and the problem it solves can be found [here][def-context-manager].\n\n## API\n\nTwo `ContextManager` implementations are exported:\n\n- `AsyncLocalStorageContextManager`, based on [`AsyncLocalStorage`](https://nodejs.org/api/async_context.html#class-asynclocalstorage)\n- `AsyncHooksContextManager`, based on [`AsyncHook`](https://nodejs.org/api/async_hooks.html#async_hooks_class_asynchook)\n\nThe former should be preferred over the latter as its implementation is substantially simpler than the latter's, and according to [Node.js docs](https://github.com/nodejs/node/blame/v17.1.0/doc/api/async_context.md#L42-L45),\n\n> While you can create your own implementation [of `AsyncLocalStorage`] on top of [`AsyncHook`], `AsyncLocalStorage` should be preferred as it is a performant and memory safe implementation that involves significant optimizations that are non-obvious to implement.\n\n`AsyncLocalStorage` is available in node `^12.17.0 || >= 13.10.0`, however `AsyncLocalStorageContextManager` is not enabled by default for node `<14.8.0` because of some important bugfixes which were introduced in `v14.8.0` (e.g., [nodejs/node#34573](https://github.com/nodejs/node/pull/34573)).\n\n## Limitations\n\nIt's possible that this package won't track context perfectly when used with certain packages. In particular, it inherits any bugs present in async_hooks. See [here][pkgs-that-break-ah] for known issues.\n\nasync_hooks is still seeing significant correctness and performance fixes, it's recommended to run the latest Node.js LTS release to benefit from said fixes.\n\n## Prior art\n\nContext propagation is a big subject when talking about tracing in Node.js. If you want more information about it here are some resources:\n\n- <https://www.npmjs.com/package/continuation-local-storage> (which was the old way of doing context propagation)\n- Datadog's own implementation for their JavaScript tracer: [here][dd-js-tracer-scope]\n- OpenTracing implementation: [here][opentracing-scope]\n- Discussion about context propagation by the Node.js Diagnostics Working Group: [here][diag-team-scope-discussion]\n\n## Useful links\n\n- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>\n- For more about OpenTelemetry JavaScript: <https://github.com/open-telemetry/opentelemetry-js>\n- For help or feedback on this project, join us in [GitHub Discussions][discussions-url]\n\n## License\n\nApache 2.0 - See [LICENSE][license-url] for more information.\n\n[discussions-url]: https://github.com/open-telemetry/opentelemetry-js/discussions\n[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/main/LICENSE\n[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat\n[async-hooks-doc]: http://nodejs.org/dist/latest/docs/api/async_hooks.html\n[def-context-manager]: https://opentelemetry.io/docs/instrumentation/js/api/context/#context-manager\n[dd-js-tracer-scope]: https://github.com/DataDog/dd-trace-js/blob/master/packages/dd-trace/src/scope.js\n[opentracing-scope]: https://github.com/opentracing/opentracing-javascript/pull/113\n[diag-team-scope-discussion]: https://github.com/nodejs/diagnostics/issues/300\n[pkgs-that-break-ah]: https://github.com/nodejs/diagnostics/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Aasync-continuity\n[npm-url]: https://www.npmjs.com/package/@opentelemetry/context-async-hooks\n[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Fcontext-async-hooks.svg\n","publish_time":1589301362893,"_cnpm_publish_time":1589301362893,"dist-tags":{"canary":"3.0.0-rc.0","latest":"3.1.0","next":"1.8.0"}}