Skip to content

feat(telemetry): anonymous opt-out usage telemetry via PostHog (5.9.0) - #93

Closed
abhishekmishragithub wants to merge 1 commit into
mainfrom
feat/telemetry
Closed

feat(telemetry): anonymous opt-out usage telemetry via PostHog (5.9.0)#93
abhishekmishragithub wants to merge 1 commit into
mainfrom
feat/telemetry

Conversation

@abhishekmishragithub

Copy link
Copy Markdown
Collaborator

What

smallestai.telemetry: fire-and-forget anonymous, opt-out product telemetry so we can see what to improve. Sends to the existing PostHog project.

Privacy (by design)

  • No PII or secrets. Never an API key, agent id, prompt, transcript, phone number, file path, or error message. Only: event name, SDK/Python/OS version, a random anonymous install id (uuid4 in a local config file, not tied to any account).
  • Geography is derived server-side by PostHog from the request IP; no location is collected client-side.
  • On by default (industry norm), opt out with SMALLESTAI_TELEMETRY=0 or DO_NOT_TRACK=1; one-time notice on first run; disclosed in the README.
  • Never blocks or raises. Daemon thread, 2s timeout, all exceptions swallowed.

Why PostHog over OTel / a custom endpoint

Product telemetry (installs, feature usage, funnels, geo) is PostHog's job; OTel is for distributed tracing (heavier, wrong shape). Sends over httpx (already a dep) to /capture/ with the write-only phc_ key, so no new dependency and no backend ingest to build.

Wiring

Checks

  • pytest tests/custom/test_telemetry.py — 5 passed (opt-out, anonymous id, no-secret payload, once-only notice).
  • mypy src/smallestai/telemetry.py — clean. CLI still runs.
  • Live: PostHog /capture/ accepts our event (see PR checks / smoke).

Draft — merging bumps 5.9.0 and auto-publishes. Hold for your review. Version assumes #90/#91/#92 merge first.

Add smallestai.telemetry: fire-and-forget anonymous product telemetry to help improve
the SDK. Privacy-first by design.

- No PII or secrets: only event name + SDK/Python/OS version + a random anonymous
  install id. Geography is derived server-side by PostHog from the request IP.
- On by default (industry norm), opt out with SMALLESTAI_TELEMETRY=0 or DO_NOT_TRACK=1;
  one-time notice on first run. Disclosed in the README.
- Sent over httpx to PostHog's /capture/ (no new dependency; phc_ key is write-only).
  Runs on a daemon thread, never blocks, never raises.
- Wired into the CLI entry (coarse command group only). Richer events (deploy outcome,
  errors) to follow once the other CLI PRs land.

Version 5.9.0.
@abhishekmishragithub

Copy link
Copy Markdown
Collaborator Author

Superseded by the consolidated release PR release/5.10.0 (single review + single version bump). Branch kept.

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