This package has been deprecated

Author message:

Deprecated in favor of @opentelemetry/instrumentation-fetch

@opentelemetry/plugin-fetch
TypeScript icon, indicating that this package has built-in type declarations

0.14.0 • Public • Published

OpenTelemetry Fetch Instrumentation for web

Gitter chat NPM Published Version dependencies devDependencies Apache License

This module provides auto instrumentation for web using fetch.

Installation

npm install --save @opentelemetry/plugin-fetch

Usage

'use strict';
import { ConsoleSpanExporter, SimpleSpanProcessor } from '@opentelemetry/tracing';
import { WebTracerProvider } from '@opentelemetry/web';
import { FetchPlugin } from '@opentelemetry/plugin-fetch';
import { ZoneContextManager } from '@opentelemetry/context-zone';

const provider = new WebTracerProvider({
  plugins: [
    new FetchPlugin(),
  ],
});

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

provider.register({
  contextManager: new ZoneContextManager(),
});

// and some test

fetch('http://localhost:8090/fetch.js');

Example Screenshots

Screenshot of the running example Screenshot of the running example Screenshot of the running example

See examples/tracer-web/fetch for a short example.

Useful links

License

Apache 2.0 - See LICENSE for more information.

Package Sidebar

Install

npm i @opentelemetry/plugin-fetch

Weekly Downloads

7

Version

0.14.0

License

Apache-2.0

Unpacked Size

42.8 kB

Total Files

18

Last publish

Collaborators

  • pichlermarc
  • bogdandrutu
  • dyladan