0.30.1 • Published 13 days ago

@opentelemetry/plugin-react-load v0.30.1

Weekly downloads
34
License
Apache-2.0
Repository
github
Last release
13 days ago

OpenTelemetry Plugin React Load

NPM Published Version Apache License

This module provides automatic instrumentation for React lifecycles for Web applications, which may be loaded using the @opentelemetry/sdk-trace-web package.

If total installation size is not constrained, it is recommended to use the @opentelemetry/auto-instrumentations-web bundle with @opentelemetry/sdk-trace-web for the most seamless instrumentation experience.

Status

MaturityComponent OwnerCompatibility
UnmaintainedN/AAPI 1.0+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

License

Apache 2.0 - See LICENSE for more information.