Socket
Book a DemoInstallSign in
Socket

@otelic/open-telemetry

Package Overview
Dependencies
Maintainers
0
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@otelic/open-telemetry

Easiest way to add searchable hosted logs & traces to NodeJS app.

latest
npmnpm
Version
1.0.11
Version published
Maintainers
0
Created
Source

@otelic/open-telemetry

Otelic.com - easiest way to add Logs, Traces & Alerts to NodeJS app

Affordable, searchable logs and traces for your application. Start for free. No monthly payments. Get your FREE API Key in the Workspace Settings at Otelic. Enjoy searchable logs, traces and alerts.

Continue using default console methods, just logs will be available to search, create alerts, see trends at https://app.otelic.com

console.log("Hello");
console.info("Hello");
console.warn("Hello");
console.error("Hello");
console.debug("Hello");

This will also add automatic traces instrumentation. Traces allow to see exactly what happen during the call.

Learn more at https://otelic.com/

Step 1: Create instrumentation file

instrumentation.ts File can be js too with any name, any path.

process.env.OTELIC_API_KEY = "Get your free API KEY at https://app.otelic.com";
process.env.OTELIC_APP_NAME = "NodeJS App";
process.env.OTELIC_SERVICE_NAME = "My Service";
process.env.OTELIC_SERVICE_VERSION = "v1";

import "@otelic/open-telemetry";

Step 2: Load instrumentation before main app with -r

This works with JavaScript and TypeScript

package.json

{
  "scripts": {
    "start": "node -r ./instrumentation.ts app.ts"
  }
}

The -r flag in Node.js stands for --require, and it allows you to preload a module before your main script runs.

If you need to preload multiple modules before your app, just use -r multiple times like so: node -r instrumentation.js -r else.js app.js

You can preload multiple modules with multiple -r flags:

  node -r ./instrumentation.ts -r ./otherSetup.ts app.ts

Step 3: Check https://app.otelic.com

  • Searchable logs
  • Create alert to trigger when errors happen for automations
  • Explore traces

**Otelic.com - easiest way to add Logs, Traces & Alerts to NodeJS app
**

Keywords

otelic

FAQs

Package last updated on 18 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts