feat: adds Snowplow events tracking client

related to gitlab#572747

Port of the POC implementation

This code creates a new tracking client that allows applications to send usage data and events. The main features include:

Core Client: A main client that can send custom events (like "button clicked" or "page viewed") to GitLab's analytics system. It requires an app ID and server URL to connect.

User Tracking: Two ways to track user-specific events:

  1. Add user information to individual events as needed
  2. Create a dedicated user tracker that automatically includes user details with every event

Flexible Configuration: Options to customize how events are sent, including batching multiple events together for efficiency (which changes from GET to POST requests).

Safety Features: The system is designed to work safely when multiple users are accessing the application simultaneously, with proper error handling for common issues like missing server URLs.

Testing: Comprehensive tests ensure all features work correctly, including concurrent usage scenarios.

The system essentially provides a clean, easy-to-use way for applications to report what users are doing back to GitLab for analytics purposes, with built-in safeguards and flexibility for different use cases.

Merge request reports

Loading