A setup helper for the OpenTelemetry SDKs (logs, metrics, traces).

After successful setup using (), use `@opentelemetry/api` to obtain the registered components.

Use the shutdown handler () to ensure your telemetry is exported before the process exits.

   const nodeSdk = new NodeSDK(); // providing no options uses OTEL_* environment variables for SDK setup.
nodeSdk.start(); // registers all configured SDK components
   const nodeSdk = new NodeSDK({
// override the list of metric reader with your own options and ignore environment variable config
// explore the docs of other options to learn more!
metricReaders: [ new PeriodicExportingMetricReader({
exporter: new OTLPMetricsExporter()
})]
});
nodeSdk.start(); // registers all configured SDK components

Constructors

Methods

Constructors

Methods