JSPM

@opentelemetry/web

0.2.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1279
  • Score
    100M100P100Q70013F
  • License Apache-2.0

OpenTelemetry Web Tracer

Package Exports

  • @opentelemetry/web

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@opentelemetry/web) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

OpenTelemetry Web

Gitter chat NPM Published Version dependencies devDependencies Apache License

This module provides automated instrumentation and tracing for Web applications.

For manual instrumentation see the @opentelemetry/web package.

How does automatic tracing work?

import { ConsoleSpanExporter, SimpleSpanProcessor } from '@opentelemetry/tracing';
import { WebTracer } from '@opentelemetry/web';
import { DocumentLoad } from '@opentelemetry/plugin-document-load';

const webTracer = new WebTracer({
  plugins: [
    new DocumentLoad()
  ]
});

webTracer.addSpanProcessor(new SimpleSpanProcessor(new ConsoleSpanExporter()));

Installation

npm install --save @opentelemetry/web

Usage

// Manual
const { WebTracer } = require('@opentelemetry/web');
const webTracer = new WebTracer();
const span = webTracer.startSpan('span1');
webTracer.withSpan(span, function () {
  this.addEvent('start');
});
span.addEvent('middle');
span.end();

License

Apache 2.0 - See LICENSE for more information.