Skip to content

Add unique userid count for Geo proxied requests to service ping

Catalin Irimie requested to merge cat-instrument-geo-proxied-unique-users into master

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

  1. Enable secondary proxying.
  2. Go to the issue, project, MR pages with a specific user
  3. 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, '')])
  4. Enable the feature flag using Feature.enable(:track_geo_proxy_events)
  5. 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.

Edited by Catalin Irimie

Merge request reports