@opentelemetry/plugin-react-load

OpenTelemetry React loading automatic instrumentation package.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@opentelemetry/plugin-react-load
354910.28.04 months ago2 years agoMinified + gzip package size for @opentelemetry/plugin-react-load in KB

Readme

OpenTelemetry Plugin React Load
!NPM Published Versionnpm-imgnpm-url !Apache Licenselicense-imagelicense-image
This module provides automated instrumentation for React lifecycles for Web applications.
Compatible with OpenTelemetry JS API and SDK 1.0+.

Installation

npm install --save @opentelemetry/plugin-react-load

Usage

import { BaseOpenTelemetryComponent } from '@opentelemetry/plugin-react-load';

// Set once for the entire plugin
BaseOpenTelemetryComponent.setLogger(logger);
BaseOpenTelemetryComponent.setTracer('name', 'version');

To instrument components, extend BaseOpenTelemetryComponent:
import { BaseOpenTelemetryComponent } from '@opentelemetry/plugin-react-load';

export class Component1 extends BaseOpenTelemetryComponent { ... }

See /examples/react-load for a short example.

Useful links

  • For more information on OpenTelemetry, visit:
  • For more about OpenTelemetry JavaScript:
  • For help or feedback on this project, join us in GitHub Discussionsdiscussions-url

License

Apache 2.0 - See LICENSElicense-url for more information.