opentelemetry-js/packages/opentelemetry-context-async...
Naseem e93a86633b
ci: lint markdown files (#1147)
* ci: add markdown linting

Signed-off-by: Naseem <naseem@transit.app>

* fix: lint markdown files

Signed-off-by: Naseem <naseem@transit.app>

* docs: add markdown lint configuration

Signed-off-by: Naseem <naseem@transit.app>

* docs: lint change log

Signed-off-by: Naseem <naseem@transit.app>
2020-06-08 15:29:21 -04:00
..
src chore: 0.8.3 release proposal (#1122) 2020-05-28 16:13:08 -04:00
test fix(asynchooks-scope): fix context loss using .with() #1101 (#1099) 2020-05-28 15:26:39 -04:00
.eslintignore fix(lint): move tslint to eslint (#892) 2020-05-20 20:42:17 -07:00
.eslintrc.js fix(lint): move tslint to eslint (#892) 2020-05-20 20:42:17 -07:00
.npmignore Rename scope to context (#853) 2020-03-13 15:01:07 -04:00
LICENSE Rename scope to context (#853) 2020-03-13 15:01:07 -04:00
README.md ci: lint markdown files (#1147) 2020-06-08 15:29:21 -04:00
package.json update nyc to 15.1.0 in all package.json file (#1140) 2020-06-03 13:35:23 -07:00
tsconfig.json Rename scope to context (#853) 2020-03-13 15:01:07 -04:00

README.md

OpenTelemetry AsyncHooks-based Context Manager

Gitter chat NPM Published Version dependencies devDependencies Apache License

This package provides async-hooks based context manager which is used internally by OpenTelemetry plugins to propagate specific context between function calls and async operations. It only targets NodeJS since async-hooks is only available there.

What is a ContextManager

The definition and why they exist is available on the readme of the context-base package.

Implementation in NodeJS

NodeJS has a specific API to track async context: async-hooks, it allows to track creation of new async operation and their respective parent. This package only handle storing a specific object for a given async hooks context.

Limitations

Even if the API is native to NodeJS, it doesn't cover all possible cases of context propagation but there is a big effort from the NodeJS team to fix those. That's why we generally advise to be on the latest LTS to benefit from performance and bug fixes.

There are known modules that break context propagation (some of them are listed there), so it's possible that the context manager doesn't work with them.

Prior arts

Context propagation is a big subject when talking about tracing in NodeJS, if you want more information about that here are some resources:

License

Apache 2.0 - See LICENSE for more information.