Add unique userid count for Geo proxied requests to service ping
What does this MR do and why?
This adds a custom header for Geo proxied events through Workhorse, and uses a HLLRedisCounter on the #show action for major controllers to store the unique users count going through the proxy.
Related to #346906 (closed)
Screenshots or screen recordings
How to set up and validate locally
Probably easiest using a GET Geo setup, then patching the Puma/Sidekiq nodes with this MR as per docs
- Enable secondary proxying.
- Go to the issue, project, MR pages with a specific user
- Check that no events are recorded in Redis:
Gitlab::Redis::HLL.count(keys: [Gitlab::UsageDataCounters::HLLRedisCounter::send(:redis_key, Gitlab::UsageDataCounters::HLLRedisCounter::send(:event_for, 'g_geo_proxied_requests'), Time.zone.now, '')])
- Enable the feature flag using
Feature.enable(:track_geo_proxy_events)
- Navigate again to an issue / project / user, then notice the result of the HLL count above changes to 1.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Catalin Irimie