Skip to content

feat: add anonymous telemetry tracking#2009

Draft
schnie wants to merge 2 commits intomainfrom
telemetry
Draft

feat: add anonymous telemetry tracking#2009
schnie wants to merge 2 commits intomainfrom
telemetry

Conversation

@schnie
Copy link
Member

@schnie schnie commented Feb 11, 2026

Summary

  • Add Segment-based telemetry to track CLI usage anonymously
  • Users can opt-out via astro telemetry disable or ASTRO_TELEMETRY_DISABLED=1 environment variable
  • Fire-and-forget pattern using detached subprocess ensures no impact on CLI responsiveness

Data Collected

  • Command path (e.g., "deploy", "dev start") - NOT arguments/values
  • CLI version
  • OS and architecture
  • Go version
  • Invocation context (agent/CI/interactive)
  • Anonymous user ID (UUID stored in config)

New Commands

  • astro telemetry status - Show current telemetry status
  • astro telemetry enable - Enable telemetry
  • astro telemetry disable - Disable telemetry

Agent/CI Detection

Detects environments like Claude Code, Cursor, Aider, GitHub Actions, GitLab CI, Jenkins, CircleCI.

Test plan

  • astro telemetry status shows enabled/disabled state
  • astro telemetry disable disables telemetry
  • astro telemetry enable re-enables telemetry
  • ASTRO_TELEMETRY_DISABLED=1 environment variable overrides config
  • Version command completes quickly (~0.08s) demonstrating fire-and-forget works
  • All existing tests pass
  • New telemetry tests pass

🤖 Generated with Claude Code

Add Segment-based telemetry to track CLI usage anonymously. Users can
opt-out via `astro telemetry disable` or ASTRO_TELEMETRY_DISABLED=1.

Features:
- Fire-and-forget pattern using detached subprocess
- Tracks command paths (not arguments/values)
- Detects agent (Claude Code, Cursor) and CI environments
- Anonymous user ID stored in config

Co-Authored-By: Claude <noreply@anthropic.com>
@schnie schnie requested a review from a team as a code owner February 11, 2026 14:42
@coveralls-official
Copy link

Pull Request Test Coverage Report for Build 55a53c96-6e1c-463c-b2bf-3f94080c6774

Details

  • 105 of 236 (44.49%) changed or added relevant lines in 5 files are covered.
  • 127 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.04%) to 33.191%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cmd/telemetry_send.go 8 13 61.54%
cmd/telemetry.go 61 71 85.92%
pkg/telemetry/send.go 0 45 0.0%
pkg/telemetry/telemetry.go 33 104 31.73%
Files with Coverage Reduction New Missed Lines %
cmd/cloud/deploy.go 10 88.89%
cloud/deploy/deploy.go 117 79.79%
Totals Coverage Status
Change from base Build e7f3543a-ee47-45c6-b0ae-d1b47b618aa7: 0.04%
Covered Lines: 20969
Relevant Lines: 63177

💛 - Coveralls

@schnie schnie marked this pull request as draft February 13, 2026 17:20
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

Comments