opentelemetry-js/packages/opentelemetry-context-base
Daniel Dyla 27a8d4530c
chore: version 0.14.0 proposal (#1763)
2020-12-17 15:44:39 -05:00
..
src chore: version 0.14.0 proposal (#1763) 2020-12-17 15:44:39 -05:00
test chore: use interface for context types (#1515) 2020-09-21 15:14:03 -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 chore: version 0.14.0 proposal (#1763) 2020-12-17 15:44:39 -05:00
tsconfig.json feat(api/context-base): change compile target to es5 (#1368) 2020-07-30 19:35:29 -07:00

README.md

OpenTelemetry Base Context Manager

Gitter chat NPM Published Version dependencies devDependencies Apache License

This package provides the ContextManager interface (which is used by concrete implementations) and a no-op implementation (which is used internally when no context propagation is defined). It's intended for use both on the server and in the browser.

What is a Context Manager

To understand why they exists, we'll need to understand how Javascript works: when you make native function call (networks, setInterval etc) you generally call C++ code that will later callback your own code.

A common issue when tracing a request in javascript is to link the function that have made the native call to the callback that the native code called when the response is there. Imagine you want to track for which user you made the request, you need some sort of "context/context aware storage".

ContextManager's aim to offer exactly that, it's API offer to store an object in the current context (with()) and if needed, bind() to a specific function call to find it back when the callback fire, which can later get retrieved using active().

This package only include the interface and a Noop implementation, for more information please see the async-hooks based ContextManager for NodeJS.

License

Apache 2.0 - See LICENSE for more information.