CLI: Add anonymous reporting metrics
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 21
- Forks
- 23
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 17
Description
It would be great to anonymously track real usage of the CLI. Whenever a command is run, we could post to some tracking service with the basic details (maybe we can include the final run status and time too?)
We should do this in a non annoying and non invasive way. I don't know if we need a GDPR expert to weigh in.
Ideally it would be opt out, so that we get tracking by default. We'll need to tell users this clearly on install. I also wonder if we should have debug logs like posting anonymous metric with command name, runtime, and exit code whenever we post a metric. Or maybe a better approach is, if metrics are enabled:
alwayslog a message like "Anonymous usage metric reporting is enabled. See for details"- Then maybe
debuglog exactly what is sent in each request
That feels like a good balance of being clear but not annoying. We can have an env var or option like OPENFN_DISABLE_METRIC_DISCLOSURE or something
To opt out, set an env var like OPENFN_DISABLE_METRICS. Lightning installs which use the CLI should do this (I suppose we could not add metrics to the metadata task, which I think is all that lightning uses the CLI for now?).
It might be nice to have a .openfnrc in the working folder to provide options like this. And maybe a default one in the repo too. Then users can do openfn set metrics false or something to set the option on their machine without using an env var (idk why this is valuable though)
Where to we report metrics to? Grafana?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the CLI command dispatch and the metadata task, since the issue specifically distinguishes ordinary CLI use from Lightning's metadata-only use. Clarify the tracking service, consent and disclosure behavior, configuration mechanism, and GDPR requirements before implementation. Done should include an agreed opt-out path, clear user disclosure, and defined anonymous metrics without reporting metadata-task usage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- analytics, cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100