Skip to content

MON-04: Add opt-in telemetry system using PostHog#1

Merged
Sorcecoder merged 4 commits into
mainfrom
agent/mon-04
Mar 2, 2026
Merged

MON-04: Add opt-in telemetry system using PostHog#1
Sorcecoder merged 4 commits into
mainfrom
agent/mon-04

Conversation

@Sorcecoder
Copy link
Copy Markdown
Contributor

Summary

  • Implemented opt-in anonymous telemetry system using PostHog Python SDK
  • First-run consent prompt asks users before enabling telemetry
  • Respects DO_NOT_TRACK environment variable
  • Anonymous device ID with SHA256 hashing for privacy
  • Non-blocking async telemetry with batching and atexit flush

Features

  • --no-telemetry flag to disable telemetry for a single session
  • --privacy flag to display telemetry information and settings
  • Tracks: cli_installed, command_executed, api_generated, error_occurred, session_duration, onboarding_completed
  • Never collects PII (no file paths, usernames, IPs, stack traces)

Test plan

  • Verify ant --privacy displays telemetry info
  • Verify ant --no-telemetry disables telemetry for session
  • Verify DO_NOT_TRACK=1 environment variable is respected
  • Verify CLI performance is not impacted (async, non-blocking)
  • Verify documentation in docs/telemetry.md
  • Verify README.md telemetry section

🤖 Generated with Claude Code

Pavel Hegler and others added 4 commits March 2, 2026 10:35
Implement a privacy-respecting telemetry system that:
- Prompts for consent on first run (opt-in only)
- Respects DO_NOT_TRACK environment variable
- Adds --no-telemetry flag to disable per session
- Adds --privacy flag to display telemetry info
- Tracks command execution and errors (type only)
- Uses PostHog Python SDK with async batching
- Never collects PII (no paths, usernames, stack traces)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add GitHub Actions workflows (build-test.yml, publish.yml)
- Add pre-commit check script (scripts/ci/run-checks.sh)
- Add dev dependencies (ruff, black, pytest) to setup.py
- Add CLAUDE.md with agent instructions
- Add .gitignore
- Fix all ruff linting errors (unused imports, undefined vars)
- Format all files with black
- Hardcode PostHog API key for automatic telemetry (users can still opt-out)
- Switch from module-level API to Posthog class instance pattern
- Use client.shutdown() instead of posthog.flush() for proper cleanup
- Update host to us.i.posthog.com for US region
@Sorcecoder Sorcecoder merged commit 78db40d into main Mar 2, 2026
3 checks passed
@Sorcecoder Sorcecoder deleted the agent/mon-04 branch March 2, 2026 21:41
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