Create Go SDK for Internal Events tracking in satellite services
Background
The Container Registry team (and other Go-based satellite services) need to implement Internal Events tracking to align with GitLab's analytics strategy. Currently, we have SDKs for Ruby and Python, but no Go implementation.
This is blocking:
- Container Registry event tracking: container-registry#1680
- Future Go satellite services that need analytics
Requirements
Core Functionality
Create a Go SDK that wraps the official Snowplow library (snowplow-golang-tracker) and provides:
- Simple tracker setup - Constructor similar to Ruby SDK example
- Event tracking API - Track method similar to Ruby SDK example
-
User context support (optional) - Add actor/user to events using
user_contextschema
Technical Specifications
-
Base Library:
snowplow-golang-tracker -
Event Schema: Use
custom_eventschema for tracked properties -
User Schema: Use
user_contextschema for user data (when applicable) -
Location: Place in
https://gitlab.com/gitlab-org/analytics-section/product-analyticsgroup -
Integration: Consider adding to
https://gitlab.com/gitlab-org/labkitfor shared use across Go services
Migration Compatibility
- DIP Migration: Ensure SDK works with future DIP migration (only emitter URL needs to change)
- Self-managed: Support both GitLab.com and self-managed instances
Reference Implementation
Use the Ruby SDK as the reference implementation. The functionality should be equivalent but adapted for Go patterns.
Acceptance Criteria
- Go SDK created with wrapper around
snowplow-golang-tracker - Simple constructor for tracker initialization
- Event tracking method that accepts custom properties
- Optional user context support
- Documentation with usage examples
- Compatible with future DIP migration
- Placed in analytics-section/product-analytics group
- Integration guidance for labkit (if applicable)
Timeline
This is needed to unblock Container Registry analytics implementation. Container Registry team is ready to help with implementation and testing.
Related Issues
- Container Registry event tracking: container-registry#1680
- Parent epic: &17448
Edited by 🤖 GitLab Bot 🤖