Skip to content

feat(telemetry): emit install events (PILOT-401)#273

Closed
matthew-pilot wants to merge 1 commit into
mainfrom
openclaw/pilot-401-20260617-021655
Closed

feat(telemetry): emit install events (PILOT-401)#273
matthew-pilot wants to merge 1 commit into
mainfrom
openclaw/pilot-401-20260617-021655

Conversation

@matthew-pilot

Copy link
Copy Markdown
Collaborator

Summary

Emit a telemetry event on successful app install, gated by consent (no-op when PILOT_TELEMETRY_URL is empty or identity.json is absent).

Changes

  1. pkg/telemetry/client.go — New package: consent-gated telemetry client with Ed25519-signed HTTP POSTs. Hard no-op when URL is empty. Includes NewClientFromIdentity(url, identityPath, nodeID) convenience constructor.

  2. pkg/telemetry/client_test.go — Tests: disabled no-op, identity loading, signer configuration, HTTP round-trip, error propagation.

  3. cmd/pilotctl/appstore.go — After a successful install (bundle validated, manifest planted, audit logs written), emit an app_installed event with app_id, version, and source (catalogue|local).

Acceptance criteria

  • Exactly one event per successful install (no double-count on --force)
  • No event on failure (install aborted before the telemetry hook)
  • Consent gate: no-op when PILOT_TELEMETRY_URL is empty
  • Best-effort: send failure is logged as warning, not fatal — install stays successful

Verification

  • go build ./... — clean
  • go vet ./... — clean
  • go test ./pkg/telemetry/ — 10/10 PASS

Closes PILOT-401

Adds a consent-gated telemetry client package and hooks it into the
appstore install command. On every successful app install, a signed
telemetry event carrying app_id, version, and source (catalogue|local)
is POSTed to the configured telemetry endpoint.

Telemetry is gated by the PILOT_TELEMETRY_URL env var — when empty
(default), the client is a hard no-op: no dial, no goroutines, no
allocations. When set, the client signs events with the node Ed25519
identity and sends them via a signed HTTP POST.

Acceptance:
- Exactly one event per successful install (no double-count on --force)
- No event on failure (install aborted before the telemetry hook)
- Consent gate: no-op when PILOT_TELEMETRY_URL is empty

Closes PILOT-401
Comment thread pkg/telemetry/client.go

ts := strconv.FormatInt(time.Now().Unix(), 10)
// Build signed message as ts + newline + body.
message := make([]byte, 0, len(ts)+1+len(body))
@TeoSlayer

Copy link
Copy Markdown
Collaborator

Superseded by #277 which combines PILOT-401/402/406/407 into a clean branch off current main.

@TeoSlayer TeoSlayer closed this Jun 17, 2026
@matthew-pilot matthew-pilot deleted the openclaw/pilot-401-20260617-021655 branch June 20, 2026 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants