cli-opentelemetry
v1.2.3
Published
Open Telemetry wrapper for NodeJs CLI tools
Downloads
21
Readme
CLI Open Telemetry
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
Usage
// 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)
);
Data Collected
service.name
- CLI Name + "-cli"service.version
- CLI Versionprocess.command_args
- process.argvos.type
- process.platformdevice.id
- uuid, uniquely identifying a device- generated and stored in
%TEMP%/sodaru-ot-id
file
- generated and stored in
city
- City Name from where the cli is executed- generated and stored in
%TEMP%/sodaru-ot-c
each day
- generated and stored in
otel.status_code
- OK or ERROR, based on the CLI resultotel.status_description
- stderr from CLI, if CLI fails
Environmental Variables
CLI_OPEN_TELEMETRY_DIAGNOSE
- If set totrue
, Prints telemetry debug logs to consoleCLI_OPEN_TELEMETRY_DISABLE
- If set to anything other than0
, The telemetry export is switched Off
Support
This project is a part of the Open Source Initiative from Sodaru Technologies
Write an email to [email protected] for queries on this project