feat(telemetry): adding initial telemetry functionality to the cli#956
Merged
feat(telemetry): adding initial telemetry functionality to the cli#956
Conversation
billxinli
commented
Dec 1, 2025
billxinli
commented
Dec 1, 2025
billxinli
commented
Dec 1, 2025
bcc83ee to
3082a6e
Compare
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Author
|
@cursor review |
1f673f5 to
da523cf
Compare
831ec39 to
36ee7fa
Compare
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This comment was marked as outdated.
This comment was marked as outdated.
36ee7fa to
bd89744
Compare
bd89744 to
45edc03
Compare
jdalton
approved these changes
Dec 16, 2025
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
This PR adds telemetry functionality to the Socket CLI to track usage patterns, performance metrics, and errors. The implementation includes instrumentation across CLI commands, subprocess executions, and API interactions.
Telemetry Infrastructure
Event Types Tracked
PII Sanitization
Example Sanitization
Telemetry Configuration
Breaking Changes
None. Telemetry is opt-in via organization configuration and fails gracefully.
Example Run:
Note
Add org-scoped telemetry across CLI lifecycle, subprocess wrappers, and SDK HTTP hooks with robust exit handling, sanitization, and comprehensive tests.
src/utils/telemetry/*with batching, flush (async/sync), session IDs, and timeouts.argvand error data; skip telemetry in test env.beforeExit,SIGINT/SIGTERM/SIGHUP) viasetupTelemetryExitHandlers().src/cli.mts):cli_start,cli_complete,cli_error; handle fatal errors (uncaughtException,unhandledRejection) and finalize telemetry before exit.src/commands/*/cmd-*.mts):subprocess_startandsubprocess_*on exit fornpm,npx,pnpm,yarn; flush telemetry before process exit.src/utils/sdk.mts):api_request,api_response,api_error(skipping/telemetryendpoints) and keep debug logs.src/utils/ecosystem.mts):ALL_ECOSYSTEMS(e.g.,alpm,qpkg,vscode) and relax a type check due to version mismatch.src/test/*.mts,src/utils/**/*test.mts).@socketsecurity/sdkto1.4.95; update lockfile.Written by Cursor Bugbot for commit 36ee7fa. Configure here.