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
6 changes: 5 additions & 1 deletion cmd/daemon/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ func main() {
sandboxDir := flag.String("sandbox-dir", "", "confinement root when -sandbox is set (default: ~/.pilot)")
motdFeedURL := flag.String("motd-feed-url", motd.DefaultFeedURL, "message-of-the-day feed URL (empty to disable); overridden by $PILOT_MOTD_URL")
motdInterval := flag.Duration("motd-interval", 0, "message-of-the-day poll interval (default 15m)")
telemetryURL := flag.String("telemetry-url", os.Getenv("PILOT_TELEMETRY_URL"),
telemetryURLDefault := os.Getenv("PILOT_TELEMETRY_URL")
if telemetryURLDefault == "" {
telemetryURLDefault = telemetry.DefaultEndpoint
}
telemetryURL := flag.String("telemetry-url", telemetryURLDefault,
"telemetry endpoint URL (empty = consent off, hard no-op). "+
"Env: PILOT_TELEMETRY_URL. Default: "+telemetry.DefaultEndpoint+".")
flag.Parse()
Expand Down
11 changes: 11 additions & 0 deletions cmd/pilotctl/appstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -2076,6 +2076,17 @@ func cmdAppStoreCall(args []string) {
fatalHint("ipc_error", hint, "%v", err)
}

// Emit app_usage telemetry for a successful call (consent-gated, best-effort).
if h, _ := os.UserHomeDir(); consent.GetConsent(h, "telemetry") {
turl := os.Getenv("PILOT_TELEMETRY_URL")
if turl == "" {
turl = telemetry.DefaultEndpoint
}
payload, _ := json.Marshal(map[string]string{"app_id": appID, "method": method})
client := telemetry.NewClientFromIdentity(turl, configDir()+"/identity.json", nodeIDFromDaemon())
_ = client.Send(telemetry.Event{Kind: "app_usage", Payload: json.RawMessage(payload)})
}

// Maybe replace the real result with a review prompt (gated by
// appstore.review_prompt feature flag + random roll).
replaced, intercepted := maybeInterceptOutput(result, appID)
Expand Down
Loading