Skip to content

Create common solution on how to count and track feature flag enabled value

What does this MR do and why?

MR adds a new metric - instance_feature_flags. It collects all FFs with local states (i.e. one with local state being changed from default) and adds it to ServicePing with extra data.

Example:

[
  {:name=>"allow_restricted_variables_at_policy_level",
    :status=>"on",
    :type=>"beta",
    :actor_counts=>{"groups"=>1, "projects"=>1, "users"=>2}},
   {:name=>"explain_vulnerability_tool", :status=>"off", :type=>"beta", :actor_counts=>{}
  }
]

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

  1. Enable or disable some FFs locally, ideally with some extra actors: Feature.enable('allow_restricted_variables_at_policy_level', Group.first)
  2. check the metric value:
> require_relative 'spec/support/helpers/service_ping_helpers.rb'
> ServicePingHelpers.get_current_usage_metric_value('instance_feature_flags')

Related to #463258 (closed)

Edited by Niko Belokolodov

Merge request reports

Loading