Skip to content

feat: analytics#301

Merged
rlmestre merged 1 commit into
mainfrom
analytics
Aug 15, 2025
Merged

feat: analytics#301
rlmestre merged 1 commit into
mainfrom
analytics

Conversation

@rlmestre
Copy link
Copy Markdown
Contributor

@rlmestre rlmestre commented Aug 12, 2025

Closes neverendingsupport/data-and-integrations#218

@rlmestre rlmestre requested a review from a team as a code owner August 12, 2025 14:46
@rlmestre rlmestre requested a review from Copilot August 12, 2025 14:47
Copy link
Copy Markdown

Copilot AI left a 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());

Comment thread src/service/analytics.svc.ts
Comment thread src/service/analytics.svc.ts
Comment thread src/service/analytics.svc.ts
Comment thread package.json
Comment thread src/service/analytics.svc.ts
Comment thread src/hooks/prerun.ts
Comment thread src/service/analytics.svc.ts
@rlmestre rlmestre merged commit 05fe08d into main Aug 15, 2025
23 of 24 checks passed
@rlmestre rlmestre deleted the analytics branch August 15, 2025 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants