-
Notifications
You must be signed in to change notification settings - Fork 9
feat: analytics #301
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
feat: analytics #301
Conversation
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.
Pull Request Overview
This PR adds analytics tracking functionality to the CLI tool to capture usage metrics and scan data. The analytics system uses Amplitude for tracking user sessions, scan operations, and error events while respecting opt-out preferences.
Key changes include:
- Implementation of comprehensive analytics service with session tracking and device identification
- Integration of analytics tracking throughout the scan workflow including SBOM generation, EOL scanning, and file operations
- Enhanced display service to extract ecosystem information from package URLs for analytics
Reviewed Changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
src/service/analytics.svc.ts | New analytics service with Amplitude integration, session management, and environment detection |
src/hooks/prerun.ts | Added analytics initialization and session start tracking |
src/hooks/finally.ts | Added session end tracking with cleanup spinner |
src/commands/scan/eol.ts | Integrated analytics tracking throughout scan workflow with performance metrics |
src/service/display.svc.ts | Enhanced component counting to include ecosystem extraction and totals |
src/config/constants.ts | Added analytics URL configuration |
test/service/display.svc.test.ts | Updated tests for enhanced component counting functionality |
package.json | Added analytics dependencies and finally hook registration |
.envrc.example | Added analytics URL environment variable example |
Comments suppressed due to low confidence (1)
src/hooks/finally.ts:10
- The promise chain may not properly handle errors, and the spinner.stop() call could execute before the analytics event is fully sent, potentially causing data loss.
})).promise.then(() => spinner.stop());
Closes neverendingsupport/data-and-integrations#218