Skip to content

Add customer health score performance indicator type

What does this MR do and why?

This MR adds ability to use new performance type in metrics definition files to indicate a metric is used for customer health scoring.

Screenshots or screen recordings

UI is not affected

How to set up and validate locally

  1. Apply a diff, something like:
diff --git a/config/metrics/counts_28d/20221121115624_i_code_review_merge_request_widget_security_reports_expand_success_monthly.yml b/config/metrics/counts_28d/20221121115624_i_code_review_merge_request_widget_security_reports_expand_success_monthly.yml
--- a/config/metrics/counts_28d/20221121115624_i_code_review_merge_request_widget_security_reports_expand_success_monthly.yml	(revision 09ef1dbf10df61fe1574c91d3dd99153187c07b0)
+++ b/config/metrics/counts_28d/20221121115624_i_code_review_merge_request_widget_security_reports_expand_success_monthly.yml	(date 1673308139840)
@@ -13,7 +13,8 @@
 data_source: redis_hll
 data_category: optional
 instrumentation_class: RedisHLLMetric
-performance_indicator_type: []
+performance_indicator_type:
+  - customer_health_score
 options:
   events:
     - i_code_review_merge_request_widget_security_reports_expand_success
  1. Validate the updated metric definition in rails console
pry(main)> Gitlab::Usage::MetricDefinition.definitions.find {|k, v| k == 'redis_hll_counters.code_review.i_code_review_merge_request_widget_security_reports_expand_success_monthly'}[1].validate!
=> {"key_path"=>{"type"=>"string"},...
(no exception raised)

Could also checkout master branch to verify it would fail.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #385201 (closed)

Edited by Niko Belokolodov

Merge request reports