-
Notifications
You must be signed in to change notification settings - Fork 33
feat(telemetry): adding initial telemetry functionality to the cli #956
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
bcc83ee to
3082a6e
Compare
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment @cursor review or bugbot run to trigger another review on this PR
|
@cursor review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment @cursor review or bugbot run to trigger another review on this PR
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
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.