open-telemetry-nodejs-tracker
v1.0.6
Published
open-telemetry-nodejs-tracer
Downloads
17
Readme
open-telemetry-nodejs-tracer
This is a nodejs package which is used for node service integration with open telemetry.
Steps to integration open telemetry with Nodejs services.
The steps to integrate open telemetry with NodeJs services.
- npm install package.
npm i [email protected]
- In you index.ts or index.js add two lines code in the top line.
import openTelemetry from 'open-telemetry-nodejs-tracker/dist/tracer';
openTelemetry.settings.setCollectorUrl('https://discoveryplatform-asb-b-001.logging.comcast.net:4318/v1/traces');
openTelemetry.settings.setServiceName('node-service1');
openTelemetry.settings.setEnvironment('development');
openTelemetry.init();
Note: You also can set collectorUrl, serviceName and enviroment by adding a .env file. for example:
OTEL_TRACE_URL=https://discoveryplatform-asb-b-001.logging.comcast.net:4318/v1/traces
OTEL_SERVICE_NAME=open-telemetry-nodejs-demo
OTEL_ENV=development