Skip to content

Always update Redis metrics

Jonas Larsen requested to merge j_lar/always-collect-redis-metrics into master

What does this MR do and why?

We want to make sure we are updating metrics in Redis independent of if they will actually me sent to GitLab as part of the Service Ping payload.

This will allow admins of self-managed instances to access the metrics themselves which is not possible without opting in to Service Ping at the moment.

How to set up and validate locally

  1. Disable Service Ping (guide)

  2. RedisHLL

    1. Check the current value of this weeks RedisHLL counter by running gdk redis-cli PFCOUNT "{hll_counters}_unique_active_user-$(date +%Y)-$(date +%U)"
    2. Try to increment the value by running Gitlab::UsageDataCounters::HLLRedisCounter.track_event('unique_active_user', values: rand(1..999999)) in gdk rails console.
    3. Validate that the value increased by running the command from 1) again
  3. Redis

    1. Check the current value of a Redis counter by running gdk redis-cli GET "WEB_IDE_VIEWS_COUNT"
    2. Try to increment the value by running Gitlab::UsageDataCounters::WebIdeCounter.increment_views_count in gdk rails console.
    3. Validate that the value increased by running the command from 1) again

If you follow the above steps on master you will see that the value is not incremented in the last steps.

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 Jonas Larsen

Merge request reports