Adds anonymous telemetry by schnie · Pull Request #2009 · astronomer/astro-cli
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
changed the title
feat: add anonymous telemetry tracking
Adds anonymous telemetry tracking
schnie
marked this pull request as ready for review
- Skip PersistentPreRunE chain for _telemetry-send subprocess to avoid network I/O, token validation, and recursive telemetry tracking - Use ordered slices instead of maps in DetectContext to ensure deterministic results (generic CI checked last) - Accept full 2xx range in Send() instead of only 200 - Collect real OS version via uname/ver instead of duplicating GOOS/GOARCH Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Already identified by the top-level source field on the payload. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Set SilenceUsage/SilenceErrors at construction time on _telemetry-send command instead of inside RunE - Write minimal config to in-memory fs before InitConfig in tests to avoid touching the real filesystem Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace test-only extractCommandPath/splitCommandPath helpers with actual cobra commands so the test exercises the production code path. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
schnie
changed the title
Adds anonymous telemetry tracking
Adds anonymous telemetry
- Bound stdin read in _telemetry-send to 64KB via io.LimitReader - Drain response body before close to allow HTTP connection reuse - Replace fragile cmd.Name() string match with cobra annotation for PersistentPreRunE bypass - Log subprocess spawn failures in debug mode - Add one-time first-run notice to stderr informing users about telemetry and how to opt out Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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