faas-cli icon indicating copy to clipboard operation
faas-cli copied to clipboard

Add opt-out analytics to CLI (implements #108)

Open johnmccabe opened this issue 8 years ago • 8 comments

Description

This PR adds an opt-out analytics capture using Google Analytics.

Refer to the included analytics.md file for details of what is being captured at this point and how to opt out from the capture.

Note it does not capture function counts etc, pending the merge of openfaas/faas#315.

@alexellis - you will need to replace the trackingID and applicationName in analytics/google_analytics.go in order to direct events to a GA account associated with the OpenFaaS project.

analytics

Motivation and Context

  • [x] I have raised an issue to propose this change (#108)

How Has This Been Tested?

Have tested the resulting client as follows:

  • on OSX and Windows
  • unresponsive analytics endpoint results in timeout
  • closed endpoint results in a fail fast
  • opt-out envvar short circuits all capture
  • blocked endpoint (PiHole) fails fast
  • events are visible live in the Real-Time/Events dashboard
  • Data Studio Dashboard created from captured event data
  • Message displayed to stderr the first time the cli is run with analytics enabled

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • [x] My code follows the code style of this project.
  • [x] My change requires a change to the documentation.
  • [x] I have updated the documentation accordingly.
  • [x] I've read the CONTRIBUTION guide
  • [x] I have signed-off my commits with git commit -s
  • [ ] I have added tests to cover my changes.
  • [x] All new and existing tests passed.

johnmccabe avatar Oct 24 '17 17:10 johnmccabe

Thank you for your contribution. I've just checked and your commit doesn't appear to be signed-off. That's something we need before your Pull Request can be merged. Please see our contributing guide.

open-derek[bot] avatar Oct 24 '17 18:10 open-derek[bot]

@alexellis do you want the steps to setup the Custom Dimensions, application, trackingID and Dashboard in GA added to these docs or stored elsewhere?

johnmccabe avatar Oct 24 '17 18:10 johnmccabe

This is brilliant 🥇

alexellis avatar Oct 24 '17 19:10 alexellis

@alexellis ignoring the rebase, is there more you need to see here

johnmccabe avatar Nov 01 '17 12:11 johnmccabe

I've started addressing your comments @alexellis will get something pushed up ASAP, been a bit off the radar recently as you're likely aware.

johnmccabe avatar Nov 15 '17 23:11 johnmccabe

Which part do you think is set at build? The runtime.* calls?

johnmccabe avatar Nov 24 '17 16:11 johnmccabe

I'll double check but I thought it was hard-coded through the build-time runtime when cross-compiling. It didn't seem to have the ARM version for sure.

alexellis avatar Nov 24 '17 17:11 alexellis

@alexellis is this worth you want to see implemented? I think it should be ok from a GDPR point of view, would need to add a privacy section to the docs however.

johnmccabe avatar Jun 10 '18 21:06 johnmccabe