Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanyu66 committed Feb 3, 2023
1 parent 1923e12 commit 970c128
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
42 changes: 21 additions & 21 deletions docs/telemetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@

`ticloud` telemetry tracks non-Personally-Identifiable Information (PII), which includes:

| Filed name | Description | Example value |
|--------------------------|-------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `timestamp` | The time when the command is executed | `2023-02-03T09:33:49.384304+08:00` |
| `source` | The name of the command | `ticloud` |
| `properties` | The map which contains properties | - |
| `properties.alias` | The alias of the command | `ls` |
| `properties.arch` | The architecture of the machine | `arm64` |
| `properties.auth_method` | The authentication method used to access the TiDB Cloud API | `api_key` |
| `properties.command` | The full command path of the command | `ticloud-project-list` |
| `properties.duration` | The execution duration of the command | `871` |
| `properties.error` | The error message of the command | `[POST /api/internal/projects/{project_id}/clusters/{cluster_id}/upload_url][403] GenerateUploadURL default \\u0026{Code:49900003 Details:[] Message:you do not have permission to access this project, project_id: 43511}` |
| `properties.flags` | The names of flags used when executing the command | `[debug, output]` |
| `properties.git_commit` | The git commit hash of the CLI | `dfdsfdsdfs` |
| `properties.installer` | The installer of the CLI | `TiUP` |
| `properties.interactive` | Whether the command is executed in interactive mode | `false` |
| `properties.os` | The operating system of the machine | `darwin` |
| `properties.project_id` | The project ID which command used | `43511` |
| `properties.result` | The result of the command, `SUCCESS` or `ERROR` | `SUCCESS` |
| `properties.terminal` | The terminal type | `tty` |
| `properties.version` | The version of the CLI | `v0.0.1` |

| Filed name | Description | Example value |
|-----------------------------|-------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `timestamp` | The time when the command is executed | `2023-02-03T09:33:49.384304+08:00` |
| `source` | The name of the command | `ticloud` |
| `properties` | The map which contains properties | - |
| `properties["alias"]` | The alias of the command | `ls` |
| `properties["arch"]` | The architecture of the machine | `arm64` |
| `properties["auth_method"]` | The authentication method used to access the TiDB Cloud API | `api_key` |
| `properties["command"]` | The full command path of the command | `ticloud-project-list` |
| `properties["duration"]` | The execution duration of the command | `871` |
| `properties["error"]` | The error message of the command | `[POST /api/internal/projects/{project_id}/clusters/{cluster_id}/upload_url][403] GenerateUploadURL default \\u0026{Code:49900003 Details:[] Message:you do not have permission to access this project, project_id: 43511}` |
| `properties["flags"]` | The names of flags used when executing the command | `[debug, output]` |
| `properties["git_commit"]` | The git commit hash of the CLI | `dfdsfdsdfs` |
| `properties["installer"]` | The installer of the CLI | `TiUP` |
| `properties["interactive"]` | Whether the command is executed in interactive mode | `false` |
| `properties["os"]` | The operating system of the machine | `darwin` |
| `properties["project_id"]` | The TiDB Cloud project ID which command used | `43511` |
| `properties["result"]` | The result of the command, `SUCCESS` or `ERROR` | `SUCCESS` |
| `properties["terminal"]` | The terminal type | `tty` |
| `properties["version"]` | The version of the CLI | `v0.0.1` |
"
To view the full content of telemetry, use flag `--debug` when running `ticloud` command.

```shell
Expand Down
2 changes: 1 addition & 1 deletion internal/telemetry/tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func newTracker(cmd *cobra.Command, args []string) (*tracker, error) {
}

func (t *tracker) defaultCommandOptions() []eventOpt {
return []eventOpt{withCommandPath(t.cmd), WithInteractive(t.cmd), withHelpCommand(t.cmd, t.args), withFlags(t.cmd), withVersion(), withOS(), withAuthMethod(), withProjectID(t.cmd), withTerminal(), withInstaller(t.installer)}
return []eventOpt{withCommandPath(t.cmd), WithInteractive(t.cmd), withFlags(t.cmd), withVersion(), withOS(), withAuthMethod(), withProjectID(t.cmd), withTerminal(), withInstaller(t.installer)}
}

func (t *tracker) trackCommand(data TrackOptions) error {
Expand Down

0 comments on commit 970c128

Please sign in to comment.