feat: add anonymous usage telemetry to ADK CLI#48
Open
christopherosborne-poly wants to merge 1 commit intopolyai:mainfrom
Open
feat: add anonymous usage telemetry to ADK CLI#48christopherosborne-poly wants to merge 1 commit intopolyai:mainfrom
christopherosborne-poly wants to merge 1 commit intopolyai:mainfrom
Conversation
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
522a173 to
f7edb2e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.pytrack(command, ...)call that fires in a daemon thread with a 2-second timeoutaccount_id,project_id,regionfrom the loaded project contextSingle integration point: one block in
_run_command()incli.py— no logic scattered across individual command handlersIngest endpoint:
https://analytics.us-1.platform.polyai.app/ingest/v1/adkWhat's collected
commandpush,pull,branchsubcommandlist,switch(branch actions)user_emailgit config user.emailuser_namegit config user.nameos_usernamehostnameadk_versionpython_version3.14.0osdarwin/linux/windowsaccount_idproject_idregiondry_runtrueonly when flag is setOpt-out
Set
POLY_TELEMETRY_DISABLED=1to disable entirely. Useful for CI/CD pipelines.Tests
All 361 existing tests pass.