Skip to content

feat: add anonymous usage telemetry to ADK CLI#48

Open
christopherosborne-poly wants to merge 1 commit intopolyai:mainfrom
christopherosborne-poly:feat/adk-telemetry
Open

feat: add anonymous usage telemetry to ADK CLI#48
christopherosborne-poly wants to merge 1 commit intopolyai:mainfrom
christopherosborne-poly:feat/adk-telemetry

Conversation

@christopherosborne-poly
Copy link
Copy Markdown

@christopherosborne-poly christopherosborne-poly commented Mar 26, 2026

What

Adds a lightweight telemetry module so the product team can see exactly who is using the ADK and how.

How it works

  • New module: src/poly/telemetry.py

    • Single track(command, ...) call that fires in a daemon thread with a 2-second timeout
    • Never blocks or errors the CLI — all exceptions are silently swallowed
    • Auto-reads account_id, project_id, region from the loaded project context
  • Single integration point: one block in _run_command() in cli.py — no logic scattered across individual command handlers

  • Ingest endpoint: https://analytics.us-1.platform.polyai.app/ingest/v1/adk

What's collected

Field Value
command e.g. push, pull, branch
subcommand e.g. list, switch (branch actions)
user_email from git config user.email
user_name from git config user.name
os_username OS login name
hostname machine hostname
adk_version package version
python_version e.g. 3.14.0
os darwin / linux / windows
account_id from project.yaml (when available)
project_id from project.yaml (when available)
region from project.yaml (when available)
dry_run true only when flag is set

Opt-out

Set POLY_TELEMETRY_DISABLED=1 to disable entirely. Useful for CI/CD pipelines.

Tests

All 361 existing tests pass.

Track CLI command invocations (command, subcommand, adk_version, os,
python_version) via a fire-and-forget background thread. No PII is
collected; the user identifier is a SHA-256 hash of the machine hostname
for unique-developer counts only.

- New module: src/poly/telemetry.py
  - track() fires a daemon thread with 2s timeout — never blocks the CLI
  - Reads account_id/project_id/region from loaded project context
  - Opt-out: POLY_TELEMETRY_DISABLED=1 env var (CI-friendly)

- cli.py: single track() call in _run_command() after logging setup
  - Covers all commands: init, pull, push, status, diff, validate,
    format, chat, branch (list/create/switch/current), review, revert

Ingest endpoint: https://analytics.us-1.platform.polyai.app/ingest/v1/adk
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.

1 participant