core-sre-otel-web
v1.0.42
Published
Bootstrap opentelemetry on web.
Downloads
109
Readme
OTEL Web Instrumentation
Bootstrap opentelemetry on web.
Installation
npm install core-sre-otel-web
Usage
Initialize Otel auto instrumentation
Import to your javascript main entry file to send automatic traces and metrics.
Required: run the cor-sre-replace-env package.
import 'core-sre-otel-web'
Initialize manually
Make sure you didn't run the replace-env package.
import { bootstrapInstrumentation } from 'core-sre-otel-web';
bootstrapInstrumentation({
serviceName: 'my-service-name',
exporterUrl: 'https://my-exporter:4318'
});
Send Metrics manually
import { sendMetricsCounter } from 'core-sre-otel-web'
sendMetricsCounter({
meterName: "meter",
metricName: "metric",
})