Skip to content

Commit

Permalink
feat: add analytics (#819)
Browse files Browse the repository at this point in the history
* feat: add analytics

This feature adds the AnalyticsHandler class to manage opt-in/opt-out and
tracking of events happening within the CLI and the Dashboard.
Introduces also the command `garden config analytics-enabled` to update your
preferences.

* docs: strip ANSI characters out of command descriptions
  • Loading branch information
10ko authored and edvald committed Jun 13, 2019
1 parent 2d5d06f commit a2fa49e
Show file tree
Hide file tree
Showing 15 changed files with 730 additions and 20 deletions.
36 changes: 32 additions & 4 deletions docs/reference/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ The following option flags can be used with any of the CLI commands:
| `--silent` | `-s` | boolean | Suppress log output. Same as setting --logger-type=quiet.
| `--env` | `-e` | string | The environment (and optionally namespace) to work against.
| `--logger-type` | | `quiet` `basic` `fancy` `json` | Set logger type.
[1mfancy:[22m updates log lines in-place when their status changes (e.g. when tasks complete),
[1mbasic:[22m appends a new log line when a log line's status changes,
[1mjson:[22m same as basic, but renders log lines as JSON,
[1mquiet:[22m suppresses all log output, same as --silent.
fancy: updates log lines in-place when their status changes (e.g. when tasks complete),
basic: appends a new log line when a log line's status changes,
json: same as basic, but renders log lines as JSON,
quiet: suppresses all log output, same as --silent.
| `--log-level` | `-l` | `error` `warn` `info` `verbose` `debug` `silly` `0` `1` `2` `3` `4` `5` | Set logger level. Values can be either string or numeric and are prioritized from 0 to 5 (highest to lowest) as follows: error: 0, warn: 1, info: 2, verbose: 3, debug: 4, silly: 5.
| `--output` | `-o` | `json` `yaml` | Output command result in specified format (note: disables progress logging and interactive functionality).
| `--emoji` | | boolean | Enable emoji in output (defaults to true if the environment supports it).
Expand Down Expand Up @@ -808,3 +808,31 @@ Throws an error and exits with code 1 if something's not right in your garden.ym

garden validate

### garden config analytics-enabled

Update your preferences regarding analytics.

To help us make Garden better, you can opt in to the collection of usage data.
We make sure all the data collected is anonymized and stripped of sensitive
information. We collect data about which commands are run, what tasks they trigger,
which API calls are made to your local Garden server, as well as some info
about the environment in which Garden runs.

You will be asked if you want to opt-in when running Garden for the
first time and you can use this command to update your preferences later.

Examples:

garden config analytics-enabled true # enable analytics
garden config analytics-enabled false # disable analytics

##### Usage

garden config analytics-enabled [enable]

##### Arguments

| Argument | Required | Description |
| -------- | -------- | ----------- |
| `enable` | No | Enable analytics. Defaults to "true"

179 changes: 173 additions & 6 deletions garden-service/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a2fa49e

Please sign in to comment.