openfaas / faas-cli

Official CLI for OpenFaaS
https://www.openfaas.com/
Other
792 stars 229 forks source link

Research item: anonymous usage analytics #108

Open alexellis opened 6 years ago

alexellis commented 6 years ago

Expected Behaviour

Track usage of commands (verbs), parameters (used), build times and other anonymous data that can help us understand usage and improve the CLI.

Remit:

.bash_profile

export OPEN_FAAS_TELEMETRY=0

Current Behaviour

Relying on unsolicited feedback / word of mouth

Possible Solution

Google Analytics (subject to costing out) - has a Golang library. https://github.com/google/google-api-go-client/blob/master/analytics/v3/analytics-gen.go

Initial work would only be a PoC

johnmccabe commented 6 years ago

I'll pick this up, have done something similar in the past.

johnmccabe commented 6 years ago

Derek assign: johnmccabe

johnmccabe commented 6 years ago

Have this working locally, will push up a PR asap - heres a screengrab of a Data Studio report, generated with a dev build - thanks to @kinghuang and @burtonr for being my guinea pigs today.

faas-cli-metrics-dashboard-alpha-testdata

johnmccabe commented 6 years ago

@alexellis can you have a think about what else might be useful to capture

Currently have

Other ideas

johnmccabe commented 6 years ago

Also, do you want this opt-in, or opt-out.

Adding a flag and support for setting an envvar that sets your preference wrt letting the project capture the basic usage info above.

johnmccabe commented 6 years ago

Derek add label: hacktoberfest

ghost commented 6 years ago

@alexellis @johnmccabe This looks great. Should we also consider:

In reference to your other ideas section

alexellis commented 6 years ago

@briansiemens - John's work right now is not around the daemon/server but at the faas-cli level.

I'd say opt out via ENV_VAR to follow the model of Brew and VSCode.

We can report functions deployed / invoked but only really if someone uses faas-cli list

In order to track back-end used, we should return a header via the gateway for system functions - or introduce an info endpoint. People should also be able to turn off the clue being leaked via the gateway for when they don't want to reveal this information. (separate proposal)

johnmccabe commented 6 years ago

@briansiemens can you clarify what you're mean by API connected.

vegasbrianc commented 6 years ago

@johnmccabe Sorry was logged into the wrong account. I was just brainstorming if we could see if something like Kong or some other service is connected or not.

alexellis commented 6 years ago

Additional useful data:

Let's checkout the new commands we've added too.

I need to checkout any legal implications or data protection notices we need to include before merging. Conceptually looks great.

On first run - should we write a $HOME/.openfaas/privacy_notice file?

alexellis commented 5 years ago

Bump on this. If we can do this in a GDPR-friendly fashion then I think we should and it will help greatly with understanding usage of the flags/templates etc.