Skip to content

Conversation

@danyelf
Copy link
Contributor

@danyelf danyelf commented Dec 5, 2025

Summary

This PR adds telemetry tracking for key user interactions to help understand usage patterns and improve the product. The implementation includes console logging for development/debugging purposes.

Changes

Tracking Events Added

  1. Lineage View Rendering (src/components/lineage/LineageView.tsx:259-293)

    • Tracks when lineage view renders with node counts
    • Groups nodes by change status (added, removed, modified, unchanged)
    • Captures view configuration:
      • View mode (changed_models vs all)
      • Impact radius enabled state
      • Column-level lineage active state
      • Right sidebar open state
  2. Navigation Tracking (app/(mainComponents)/NavBar.tsx:87-94)

    • Tracks tab navigation changes between Lineage, Query, and Checklist tabs
    • Uses useRef to maintain previous pathname for accurate from/to tracking
  3. Environment Configuration Tracking (src/components/app/EnvInfo.tsx:160-173)

    • Tracks environment setup once at startup
    • Captures non-sensitive configuration data:
      • Review mode status
      • Adapter type (dbt/sqlmesh)
      • Git and PR info presence
      • Schema counts and dbt versions (for dbt adapter)
      • Environment presence (for sqlmesh adapter)

Development/Debug Features

  1. Console Logging (src/lib/api/track.ts:15-57)
    • Adds amplitudeInitialized flag to track initialization state
    • Logs all tracking events to console when Amplitude is not initialized
    • Adds startup message indicating tracking mode (Amplitude vs console only)
    • Makes tracking events visible during local development
    • Helps verify tracking implementation without Amplitude API key

Implementation Details

  • All tracking functions are non-blocking and don't affect user experience
  • Tracking data excludes sensitive information (PII-safe)
  • Console logging is always enabled (not just in dev mode) to help verify tracking in all environments
  • Uses existing Amplitude tracking infrastructure
  • Follows existing tracking patterns in the codebase

Test Plan

  • Build frontend successfully
  • All Jest tests pass
  • Linting passes (biome check)
  • TypeScript compilation succeeds
  • Server starts and serves frontend
  • Verify tracking events appear in browser console when navigating
  • Verify lineage view render tracking includes node counts
  • Verify environment config tracking fires once at startup

Testing Locally

  1. Start Recce server without Amplitude API key
  2. Open browser console
  3. Navigate to lineage view - should see [Tracking] [Web] lineage_view_render with node counts
  4. Navigate between tabs - should see [Tracking] [Web] navigation_change with from/to paths
  5. Refresh page - should see [Tracking] [Web] environment_config at startup

🤖 Generated with Claude Code

@danyelf danyelf requested review from gcko and removed request for gcko December 5, 2025 05:56
@danyelf danyelf marked this pull request as draft December 5, 2025 05:57
@danyelf danyelf force-pushed the danyel.basic-instrumentation-node-count branch from 4772ab5 to d7d08eb Compare December 5, 2025 05:59
@danyelf danyelf marked this pull request as ready for review December 5, 2025 06:01
This PR adds telemetry tracking for key user interactions:

**Lineage View Rendering Tracking:**
- Tracks node counts grouped by change status (added, removed, modified, unchanged)
- Captures view configuration (view mode, impact radius, column-level lineage, sidebar state)
- Located in: LineageView.tsx:259-293

**Navigation Tracking:**
- Tracks tab navigation between Lineage, Query, and Checklist
- Uses useRef for accurate from/to tracking
- Located in: NavBar.tsx:87-94

**Environment Configuration Tracking:**
- Tracks environment setup once at startup (non-sensitive data only)
- Captures adapter type, git/PR info, schema counts, dbt versions
- Located in: EnvInfo.tsx:160-173

**Console Logging for Development:**
- Logs tracking events to console when Amplitude is not initialized
- Adds startup message indicating tracking mode
- Makes tracking visible during development
- Located in: track.ts:15-57

All tracking is non-blocking and excludes sensitive information.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Signed-off-by: danyel fisher <[email protected]>
@danyelf danyelf force-pushed the danyel.basic-instrumentation-node-count branch from d7d08eb to 310b9ef Compare December 5, 2025 06:03
@danyelf danyelf requested review from gcko and popcornylu December 5, 2025 06:05
Copy link
Contributor

@popcornylu popcornylu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@popcornylu popcornylu merged commit e5a973c into DataRecce:main Dec 5, 2025
2 checks passed
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.

2 participants