feat(analytics): attribute requests by client surface and add CLI usage telemetry - #7763
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
…stderr, re-read telemetry state before send
Collaborator
Author
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.
Summary
X-Sim-Client-Info(<surface>[/version]; <runtime>/<v>; os/<os>; arch/<arch>; agent/<slug>) as the one header every official client sends; parser/formatter/resolver in@sim/utils/client-infowithRouteHandlerresolves the client once (header → legacysim-cli/user agent → Fetch Metadata for uncredentialed browser requests) into the logger request context; every log line and server-side PostHog event now carriessurface,client_version,coding_agentauth_kind,auth_service,auth_client_id); the workflow call chain fromX-Sim-Viaand the API method/path are stamped toorequestJson; desktop shell stampsdesktop/<version>; electron/<v>on every app-origin request from the main process; posthog-js registerssurfaceandapp_versionas super propertiesX-Sim-Client-Infowith coding-agent detection (Claude Code, Codex, Cursor, Gemini CLI, Amp, Cline, and the genericAI_AGENT/AGENTconventions), plus anonymous usage telemetry — onecli_command_executedevent per command (command path, flag names only, arg count, exit code, duration, session sequence), sent from a detached child so the prompt never waitsDO_NOT_TRACKandSIM_TELEMETRY_DISABLED, addssim telemetry status|enable|disable, and only reports from builds made withSIM_CLI_TELEMETRY_KEY(public PostHog token injected at publish time via--env); the agent hint is withheld when reporting is offX-Sim-Client-Infoand aUser-Agenttelemetrycommand page, env var tablesType of Change
Testing
bun run check:audits,check:api-validation,check:cli-docs,docs-manifest:check, repo lint, and type-check across all touched packages passChecklist