Open Telemetry wrapper for NodeJs CLI tools
npm install cli-opentelemetry> Collecting Telemetry information about the CLI Commands Usage helps to understand and improve the tools
> Open Telemetry is the vendor agnostic standard to collect and process telemetry information
This library helps to collect the telemetry data from CLI Tools and export the data to the OpenTelemetry Collector backend
``javascript
// bin/cli.js
require("cli-opentelemetry").tele(
"cli", // CLI Name
require("path").join(__dirname, "../dist/index.js"), // Path to Javascript File, CLI Entry point
"1.0.0", // version of the CLI
"http://localhost:4318/v1/traces", // URL to OTLP ProtoBuf endpoint (Optional, defaults to http://localhost:4318/v1/traces)
{}, // Headers to be send to OTLP Endpoint (Optional, defaults to emptry object)
2000, // timeout in ms , to end the span if the underlying CLI takes more time
"node" // Program to run, (Optional, defaults to node)
);
`
- service.name - CLI Name + "-cli"service.version
- - CLI Versionprocess.command_args
- - process.argvos.type
- - process.platformdevice.id
- - uuid, uniquely identifying a device%TEMP%/sodaru-ot-id
- generated and stored in filecity
- - City Name from where the cli is executed%TEMP%/sodaru-ot-c
- generated and stored in each dayotel.status_code
- - OK or ERROR, based on the CLI resultotel.status_description
- - stderr from CLI, if CLI fails
- CLI_OPEN_TELEMETRY_DIAGNOSE - If set to true, Prints telemetry debug logs to consoleCLI_OPEN_TELEMETRY_DISABLE
- - If set to anything other than 0`, The telemetry export is switched Off
This project is a part of the Open Source Initiative from Sodaru Technologies
Write an email to opensource@sodaru.com for queries on this project