criticalmanufacturing / cli

Critical Manufacturing Projects Command Line Tool
https://criticalmanufacturing.github.io/cli/
BSD 3-Clause "New" or "Revised" License
12 stars 28 forks source link

CLI telemetry #193

Closed m-s- closed 2 years ago

m-s- commented 2 years ago

This PR contains opt-in telemetry for CLI and CLI plugins. There are two levels: basic and extended telemetry.

Telemetry implementation

Basic telemetry currently only tracks the CLI startup and logs:

no identifiable information is collected in basic telemetry

However, any user can optionally enable extended telemetry, which might help with troubleshooting. Extended telemetry includes identifiable information and as such should be used with care. This includes the basic telemetry, plus:

It also tracks and logs the package tree if, for any command, the tree must be computed. This includes all of the above information plus the package name, for each package in the tree.

Enabling telemetry can be done via environment variables:

Pipelines

NOTE: The CI-Package pipeline is shipped with telemetry ON. The provided pipelines are built for Critical Manufacturing use and provided as an example for the user to build their own. As at CM we keep telemetry on for troubleshooting, the generated pipelines have telemetry on. To disable, search for the cmf_cli_enable_telemetry environment variable in the pipeline YAML and disable it.

Highlights: