Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ The CLI follows a resource-oriented architecture:
- **Resources** (`internal/resource/`) — Unified interface for API objects with field introspection
- **Multi-Metro** (`internal/multimetro/`) — Client abstraction for global infrastructure operations
- **Configuration** (`internal/config/`) — Profile and credential management
- **Telemetry** (`internal/telemetry/`) — Anonymous usage analytics (opt-out via `--no-telemetry`)
- **Telemetry** (`internal/telemetry/`) — Usage analytics (opt-out via `--no-telemetry`)

### Key Dependencies

Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ The CLI stores configuration in `~/.config/unikraft/config.yaml` (or the path sp
| `UNIKRAFT_PROFILE_ENV` | Use a virtual profile from `UKC_*` env vars instead of config (`true`, `false`) |
| `UNIKRAFT_LOG_LEVEL` | Set log level (`trace`, `debug`, `info`, `warn`, `error`, `fatal`) |
| `UNIKRAFT_LOG_TYPE` | Set output format (`text`, `json`) |
| `UNIKRAFT_TELEMETRY` | Enable/disable anonymous telemetry (`true`, `false`) |
| `UNIKRAFT_TELEMETRY` | Enable/disable usage analytics (`true`, `false`) |
| `UKC_TOKEN` | API token for legacy profiles / `UNIKRAFT_PROFILE_ENV` |
| `UKC_METRO` | Metro name (e.g. `fra`) or full endpoint URL for legacy profiles / `UNIKRAFT_PROFILE_ENV` |
| `UKC_ALLOW_INSECURE` | Skip TLS verification for the metro from `UKC_METRO` (`true`, `false`) |
Expand Down Expand Up @@ -417,8 +417,9 @@ unikraft completion -c powershell > unikraft.ps1

## Telemetry

The CLI collects anonymous usage analytics to improve the product.
No personally identifiable information is collected.
The CLI collects usage analytics to improve the product.
When you are logged in, events are keyed to the user and organization UUIDs of the active profile.
Otherwise, events use an anonymous machine hash.
To opt out:

```sh
Expand Down
17 changes: 9 additions & 8 deletions cmd/unikraft/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,12 @@ func run(ctx context.Context, args []string, stdio config.Stdio) (context.Contex

// Initialize analytics if telemetry is enabled.
//
// These are anonymous usage analytics, and no personally identifiable
// information is collected. This information is used to help us understand
// how the CLI is being used and to improve it over time. We may collect
// information such as which commands are used, how often they are used, and
// any errors that occur. This data is aggregated and analyzed to identify
// trends and areas for improvement.
// These usage analytics are keyed to the logged-in account when there is
// one, and anonymous otherwise. This information is used to help us
// understand how the CLI is being used and to improve it over time. We may
// collect information such as which commands are used, how often they are
// used, and any errors that occur. This data is aggregated and analyzed to
// identify trends and areas for improvement.
//
// Unikraft is committed to user privacy and data protection; visit[0] for
// more information.
Expand All @@ -173,15 +173,16 @@ func run(ctx context.Context, args []string, stdio config.Stdio) (context.Contex
// for our CLI.
_, doNotTrack := os.LookupEnv("DO_NOT_TRACK")
if !doNotTrack && opts.Telemetry && !isSendAnalytics {
if err := telemetry.Init(); err != nil {
profile, _ := config.G(ctx).CurrentProfile()
if err := telemetry.Init(profile); err != nil {
log.G(ctx).
Debug().
Err(err).
Msg("failed to initialize analytics, telemetry is disabled")
} else {
log.G(ctx).
Debug().
Msg("collecting anonymous usage analytics, set `UNIKRAFT_TELEMETRY=false` to disable")
Msg("collecting usage analytics, set `UNIKRAFT_TELEMETRY=false` to disable")
}
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/unikraft/testdata/TestHelp/api

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

20 changes: 10 additions & 10 deletions cmd/unikraft/testdata/TestHelp/auth

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

2 changes: 1 addition & 1 deletion cmd/unikraft/testdata/TestHelp/build

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

12 changes: 6 additions & 6 deletions cmd/unikraft/testdata/TestHelp/certificates

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

22 changes: 12 additions & 10 deletions cmd/unikraft/testdata/TestHelp/config

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

8 changes: 4 additions & 4 deletions cmd/unikraft/testdata/TestHelp/general

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

10 changes: 5 additions & 5 deletions cmd/unikraft/testdata/TestHelp/images

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

Loading
Loading