1npm i @otelic/open-telemetry
1process.env.OTELIC_API_KEY = "Get your free API KEY at https://app.otelic.com";
2process.env.OTELIC_APP_NAME = "NodeJS App";
3process.env.OTELIC_SERVICE_NAME = "My Service";
4process.env.OTELIC_SERVICE_VERSION = "v1";
5
6import "@otelic/open-telemetry";
1{
2 "scripts": {
3 "start": "node -r ./instrumentation.ts app.ts"
4 }
5}
1node -r ./instrumentation.ts -r ./otherSetup.ts app.ts
1console.log("Hello");
2console.info("Info message");
3console.warn("Warning");
4console.error("Error");
5console.debug("Debug message");