Skip to content

Prepare for enabling `redis_hll_property_name_tracking` feature flag

Michał Wielich requested to merge michold-enable-property-name-ff into master

What does this MR do and why?

Related to #415139 (closed)

After collecting all the necessary parts on master branch (for both saving & reading property_name in Redis keys), we should be able to enable the feature flag.

To prepare, we need to re-generate the overrides file. We should also not need to stub the feature flag as false for the specs anymore.

Flag rollout issue: #432866 (closed)

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Something that we want to be fully sure about is that this feature flag is not affecting any metrics. To check that, we can:

  1. Disable the feature flag: Feature.disable(:redis_hll_property_name_tracking)
  2. Enable the gdk and perform some actions: for example, create an issue, add comments, create an epic, add an emote reaction
  3. Checkout the master branch and generate the next week's Service Ping in the rails console:
require 'active_support/testing/time_helpers'
include ActiveSupport::Testing::TimeHelpers
sp = travel_to(Date.today + 7.days) { Gitlab::Usage::ServicePingReport.for(output: :all_metrics_values) }
  1. Checkout this MR's branch and go back to the rails console:
reload!
Feature.enable(:redis_hll_property_name_tracking)
sp2 = travel_to(Date.today + 7.days) { Gitlab::Usage::ServicePingReport.for(output: :all_metrics_values) }
  1. Select all the keys that are different between these two service pings:
def find_different_keys(h1, h2, result, current_key = '')
  raise StandardError if h1.keys != h2.keys

  diffs = h1.keys.each do |k|
    if h1[k].is_a?(Hash)
      result = find_different_keys(h1[k], h2[k], result, current_key + "#{k}.")
    else
      (h1[k] != h2[k]) ? result += [current_key + "#{k}"] : nil
    end
  end

  result
end

find_different_keys(sp, sp2, [])

This should only list metrics that are not calculated using RedisHLL. For example, in my case, it was:

["elasticsearch_enabled",
 "geo_enabled",
 "gitlab_pages.enabled",
 "database.flavor",
 "object_store.artifacts.enabled",
 "object_store.artifacts.object_store.enabled",
 "object_store.artifacts.object_store.direct_upload",
 "object_store.artifacts.object_store.background_upload",
 "object_store.external_diffs.enabled",
 "object_store.external_diffs.object_store.enabled",
 "object_store.external_diffs.object_store.direct_upload",
 "object_store.external_diffs.object_store.background_upload",
 "object_store.lfs.enabled",
 "object_store.lfs.object_store.enabled",
 "object_store.lfs.object_store.direct_upload",
 "object_store.lfs.object_store.background_upload",
 "object_store.uploads.enabled",
 "object_store.uploads.object_store.enabled",
 "object_store.uploads.object_store.direct_upload",
 "object_store.uploads.object_store.background_upload",
 "object_store.packages.enabled",
 "object_store.packages.object_store.enabled",
 "object_store.packages.object_store.direct_upload",
 "object_store.packages.object_store.background_upload",
 "topology.duration_s"]

If you got any other keys, they can be checked by searching for the key in https://metrics.gitlab.com/ [for exmaple: here]. After loading a row, make sure that the source column for it is not redis_hll or internal_events. For the given example, the source is system.

Edited by Michał Wielich

Merge request reports