@opencensus/web-propagation-tracecontext

OpenCensus Trace Context format propagation for the web browser

Usage no npm install needed!

<script type="module">
  import opencensusWebPropagationTracecontext from 'https://cdn.skypack.dev/@opencensus/web-propagation-tracecontext';
</script>

README

OpenCensus Trace Context format propagation for web browsers

Gitter chat

For overview and usage info see the main OpenCensus Web readme.

OpenCensus Trace Context format propagation provides utilities to serialize and deserialize a trace context header in the W3C Trace Context format.

The library is in alpha stage and the API is subject to change.

Usage

Currently the primary intended usage of OpenCensus Web is to collect spans from the resource timing waterfall of an initial page load and trace on-page user interactions with a series of features like automatic tracing for clicks and route transitions, custom spans, and browser [Performance API][performance-api] data. See the OpenCensus Web readme for details.

This package is currently used to deserialize the window.traceparent global variable that the server can send back to the client to indicate the parent trace context for the initial page load.

This is also used to propagate trace contextspans for XHRs in the user interactions, serializing a traceparent header to send along to XHR calls.

Useful links

License

Apache 2.0 - See LICENSE for more information.