Skip to content

Commit e374db9

Browse files
committed
fix: usage data feedback
Responded to PR feedback: - Changed setting location to use $HOME. - Added location of anonymous id. - Added info on how to import TelemetryLogger. - Error object was originally meant to be pseudocode but it looks too much like an object, changed to typescript. Signed-off-by: Tim deBoer <[email protected]>
1 parent 8928cd0 commit e374db9

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

USAGE_DATA.md

+12-6
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ Podman Desktop uses telemetry to collect anonymous usage data in order to identi
66
Users are prompted during first startup to accept or decline telemetry. This setting can be
77
changed at any time in Settings > Preferences > Telemetry.
88

9-
On disk this is stored in the `"telemetry.*"` keys within the settings file,
10-
at `~/.local/share/containers/podman-desktop/configuration/settings.json`.
9+
On disk the setting is stored in the `"telemetry.*"` keys within the settings file,
10+
at `$HOME/.local/share/containers/podman-desktop/configuration/settings.json`. A generated anonymous id
11+
is stored at `$HOME/.redhat/anonymousId`.
1112

1213
## What's included in the telemetry data
1314

@@ -32,17 +33,22 @@ Likewise, content like error messages often contains user-identifiable data like
3233

3334
### What to collect
3435

36+
Extensions can access the telemetry logger from the Podman Desktop API:
37+
```
38+
import { TelemetryLogger } from '@podman-desktop/api';
39+
```
40+
3541
Telemetry should never be collected 'because we can', but because we want to see current behaviour in order to improve it. This means that we should only collect the minimal data in order to meet those goals, but conversely that we also collect enough to be able to act. For instance, collecting command pass/fail would tell us how often it failed, but not why it's failing in order to fix a bug or improve usability.
3642

3743
When we capture information about commands and whether they succeed, they should be sent using logUsage() as a single event after an action completes, with optional error attributes. This makes it much easier to track the success rate and correlate failures with differences in environment or usage. logError() is typically used for independent or background errors.
3844

3945
When calling logUsage() after an external commandline process or REST interface has failed, include an error object that contains the standard properties, e.g.:
4046

41-
```
47+
```ts
4248
error {
43-
message : string
44-
statusCode : int - for HTTP calls
45-
exitCode : int - for processes
49+
message: string,
50+
statusCode: number, // for HTTP calls
51+
exitCode: number, // for processes
4652
...
4753
}
4854
```

0 commit comments

Comments
 (0)