From 86c796520f347b0fc7d2e0298816e48101e0f1d0 Mon Sep 17 00:00:00 2001 From: Thomas Randolph Date: Wed, 8 Mar 2023 13:53:19 -0700 Subject: [PATCH 1/5] Remove non-standard `i_testing` events from the telemetry framework --- .../components/extensions/telemetry.js | 104 +----------------- .../mr_widget_options_spec.js | 27 ----- 2 files changed, 1 insertion(+), 130 deletions(-) diff --git a/app/assets/javascripts/vue_merge_request_widget/components/extensions/telemetry.js b/app/assets/javascripts/vue_merge_request_widget/components/extensions/telemetry.js index e3f87c08ad4f6f..4f8f8d6cb58097 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/extensions/telemetry.js +++ b/app/assets/javascripts/vue_merge_request_widget/components/extensions/telemetry.js @@ -6,86 +6,6 @@ import { TELEMETRY_WIDGET_FULL_REPORT_CLICKED, } from '../../constants'; -/* - * Additional events to send beyond the defaults for certain widget extensions - */ -const nonStandardEvents = { - codeQuality: { - uniqueUser: { - expand: ['i_testing_code_quality_widget_total'], - }, - counter: {}, - }, - terraform: { - uniqueUser: { - expand: ['i_testing_terraform_widget_total'], - }, - counter: {}, - }, - issues: { - uniqueUser: { - expand: ['i_testing_issues_widget_total'], - }, - counter: {}, - }, - testSummary: { - uniqueUser: { - expand: ['i_testing_summary_widget_total'], - }, - counter: {}, - }, - metrics: { - uniqueUser: { - expand: ['i_testing_metrics_report_widget_total'], - }, - counter: {}, - }, - browserPerformance: { - uniqueUser: { - expand: ['i_testing_web_performance_widget_total'], - }, - counter: {}, - }, - licenseCompliance: { - uniqueUser: { - expand: ['i_testing_license_compliance_widget_total'], - }, - counter: {}, - }, - loadPerformance: { - uniqueUser: { - expand: ['i_testing_load_performance_widget_total'], - }, - counter: {}, - }, - statusChecks: { - uniqueUser: { - expand: ['i_testing_status_checks_widget'], - }, - counter: {}, - }, -}; - -function combineDeepArray(path, ...objects) { - const parts = path.split('.'); - const allEntries = objects.reduce((entries, currentObject) => { - let expandedEntries = entries; - let traversed = currentObject; - - parts.forEach((part) => { - traversed = traversed?.[part]; - }); - - if (traversed) { - expandedEntries = [...entries, ...traversed]; - } - - return expandedEntries; - }, []); - - return Array.from(new Set(allEntries)); -} - function simplifyWidgetName(componentName) { const noWidget = componentName.replace(/^Widget/, ''); @@ -166,7 +86,6 @@ function defaultBehaviorEvents({ bus, config }) { function baseTelemetry(componentName) { const simpleExtensionName = simplifyWidgetName(componentName); - const additionalNonStandard = nonStandardEvents[simpleExtensionName] || {}; /* * Telemetry config format is: * { @@ -179,7 +98,7 @@ function baseTelemetry(componentName) { * - uniqueUser is sent to RedisHLL * - counter is sent to a regular Redis counter */ - const defaultTelemetry = { + return { uniqueUser: { view: [`${baseRedisEventName(simpleExtensionName)}_view`], expand: [`${baseRedisEventName(simpleExtensionName)}_expand`], @@ -191,27 +110,6 @@ function baseTelemetry(componentName) { clickFullReport: [`${baseRedisEventName(simpleExtensionName)}_count_click_full_report`], }, }; - - return { - uniqueUser: { - view: combineDeepArray('uniqueUser.view', defaultTelemetry, additionalNonStandard), - expand: combineDeepArray('uniqueUser.expand', defaultTelemetry, additionalNonStandard), - clickFullReport: combineDeepArray( - 'uniqueUser.clickFullReport', - defaultTelemetry, - additionalNonStandard, - ), - }, - counter: { - view: combineDeepArray('counter.view', defaultTelemetry, additionalNonStandard), - expand: combineDeepArray('counter.expand', defaultTelemetry, additionalNonStandard), - clickFullReport: combineDeepArray( - 'counter.clickFullReport', - defaultTelemetry, - additionalNonStandard, - ), - }, - }; } export function createTelemetryHub(componentName) { diff --git a/spec/frontend/vue_merge_request_widget/mr_widget_options_spec.js b/spec/frontend/vue_merge_request_widget/mr_widget_options_spec.js index fad501ee7f50b6..dfc2ee8e13cb04 100644 --- a/spec/frontend/vue_merge_request_widget/mr_widget_options_spec.js +++ b/spec/frontend/vue_merge_request_widget/mr_widget_options_spec.js @@ -1197,33 +1197,6 @@ describe('MrWidgetOptions', () => { 'i_code_review_merge_request_widget_test_extension_count_expand_warning', ); }); - - it.each` - widgetName | nonStandardEvent - ${'WidgetCodeQuality'} | ${'i_testing_code_quality_widget_total'} - ${'WidgetTerraform'} | ${'i_testing_terraform_widget_total'} - ${'WidgetIssues'} | ${'i_testing_issues_widget_total'} - ${'WidgetTestSummary'} | ${'i_testing_summary_widget_total'} - `( - "sends non-standard events for the '$widgetName' widget", - async ({ widgetName, nonStandardEvent }) => { - const definition = { - ...workingExtension(), - name: widgetName, - }; - - registerExtension(definition); - createComponent(); - - await waitForPromises(); - - api.trackRedisHllUserEvent.mockClear(); - - findExtensionToggleButton().trigger('click'); - - expect(api.trackRedisHllUserEvent).toHaveBeenCalledWith(nonStandardEvent); - }, - ); }); it('triggers the "full report clicked" events when the appropriate button is clicked', () => { -- GitLab From 2bcd4515ad84ace553fda80b3dbc0b158fde554c Mon Sep 17 00:00:00 2001 From: Thomas Randolph Date: Thu, 23 Mar 2023 15:39:57 -0600 Subject: [PATCH 2/5] Remove single-event metrics for deprecated events --- .../20210413205507_i_testing_summary_widget_total_monthly.yml | 4 +++- .../20210413205507_i_testing_summary_widget_total_weekly.yml | 4 +++- ...16182139_i_testing_metrics_report_widget_total_monthly.yml | 4 +++- ...6182151_i_testing_web_performance_widget_total_monthly.yml | 4 +++- ...182156_i_testing_load_performance_widget_total_monthly.yml | 4 +++- ...216182138_i_testing_metrics_report_widget_total_weekly.yml | 4 +++- ...16182149_i_testing_web_performance_widget_total_weekly.yml | 4 +++- ...6182154_i_testing_load_performance_widget_total_weekly.yml | 4 +++- 8 files changed, 24 insertions(+), 8 deletions(-) diff --git a/config/metrics/counts_28d/20210413205507_i_testing_summary_widget_total_monthly.yml b/config/metrics/counts_28d/20210413205507_i_testing_summary_widget_total_monthly.yml index ed25f2c18a80bf..cdbd4b97ab9568 100644 --- a/config/metrics/counts_28d/20210413205507_i_testing_summary_widget_total_monthly.yml +++ b/config/metrics/counts_28d/20210413205507_i_testing_summary_widget_total_monthly.yml @@ -7,9 +7,11 @@ product_stage: verify product_group: pipeline_execution product_category: testing value_type: number -status: active +status: removed milestone: "13.11" +milestone_removed: "15.11" introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/59316 +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/114018 time_frame: 28d data_source: redis_hll instrumentation_class: RedisHLLMetric diff --git a/config/metrics/counts_7d/20210413205507_i_testing_summary_widget_total_weekly.yml b/config/metrics/counts_7d/20210413205507_i_testing_summary_widget_total_weekly.yml index 015fd1e99b05fb..9bb065e3a0ef28 100644 --- a/config/metrics/counts_7d/20210413205507_i_testing_summary_widget_total_weekly.yml +++ b/config/metrics/counts_7d/20210413205507_i_testing_summary_widget_total_weekly.yml @@ -7,9 +7,11 @@ product_stage: verify product_group: pipeline_execution product_category: testing value_type: number -status: active +status: removed milestone: "13.11" +milestone_removed: "15.11" introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/59316 +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/114018 time_frame: 7d data_source: redis_hll instrumentation_class: RedisHLLMetric diff --git a/ee/config/metrics/counts_28d/20210216182139_i_testing_metrics_report_widget_total_monthly.yml b/ee/config/metrics/counts_28d/20210216182139_i_testing_metrics_report_widget_total_monthly.yml index 727107aa242541..c09fa04de0b5f3 100644 --- a/ee/config/metrics/counts_28d/20210216182139_i_testing_metrics_report_widget_total_monthly.yml +++ b/ee/config/metrics/counts_28d/20210216182139_i_testing_metrics_report_widget_total_monthly.yml @@ -7,7 +7,7 @@ product_stage: verify product_group: pipeline_execution product_category: code_testing value_type: number -status: active +status: removed time_frame: 28d data_source: redis_hll instrumentation_class: RedisHLLMetric @@ -21,3 +21,5 @@ tier: - ultimate performance_indicator_type: [] milestone: "<13.9" +milestone_removed: "15.11" +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/114018 diff --git a/ee/config/metrics/counts_28d/20210216182151_i_testing_web_performance_widget_total_monthly.yml b/ee/config/metrics/counts_28d/20210216182151_i_testing_web_performance_widget_total_monthly.yml index 5232972a7a31e6..8b23d034fca0ec 100644 --- a/ee/config/metrics/counts_28d/20210216182151_i_testing_web_performance_widget_total_monthly.yml +++ b/ee/config/metrics/counts_28d/20210216182151_i_testing_web_performance_widget_total_monthly.yml @@ -8,7 +8,7 @@ product_stage: verify product_group: pipeline_execution product_category: web_performance value_type: number -status: active +status: removed time_frame: 28d data_source: redis_hll instrumentation_class: RedisHLLMetric @@ -22,3 +22,5 @@ tier: - ultimate performance_indicator_type: [] milestone: "<13.9" +milestone_removed: "15.11" +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/114018 diff --git a/ee/config/metrics/counts_28d/20210216182156_i_testing_load_performance_widget_total_monthly.yml b/ee/config/metrics/counts_28d/20210216182156_i_testing_load_performance_widget_total_monthly.yml index f4a5001806b0aa..948113c8498e96 100644 --- a/ee/config/metrics/counts_28d/20210216182156_i_testing_load_performance_widget_total_monthly.yml +++ b/ee/config/metrics/counts_28d/20210216182156_i_testing_load_performance_widget_total_monthly.yml @@ -8,7 +8,7 @@ product_stage: verify product_group: pipeline_execution product_category: load_testing value_type: number -status: active +status: removed time_frame: 28d data_source: redis_hll instrumentation_class: RedisHLLMetric @@ -22,3 +22,5 @@ tier: - ultimate performance_indicator_type: [] milestone: "<13.9" +milestone_removed: "15.11" +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/114018 diff --git a/ee/config/metrics/counts_7d/20210216182138_i_testing_metrics_report_widget_total_weekly.yml b/ee/config/metrics/counts_7d/20210216182138_i_testing_metrics_report_widget_total_weekly.yml index 22aea2fae0a776..c735a7a8722c84 100644 --- a/ee/config/metrics/counts_7d/20210216182138_i_testing_metrics_report_widget_total_weekly.yml +++ b/ee/config/metrics/counts_7d/20210216182138_i_testing_metrics_report_widget_total_weekly.yml @@ -7,7 +7,7 @@ product_stage: verify product_group: pipeline_execution product_category: code_testing value_type: number -status: active +status: removed time_frame: 7d data_source: redis_hll instrumentation_class: RedisHLLMetric @@ -21,3 +21,5 @@ tier: - ultimate performance_indicator_type: [] milestone: "<13.9" +milestone_removed: "15.11" +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/114018 diff --git a/ee/config/metrics/counts_7d/20210216182149_i_testing_web_performance_widget_total_weekly.yml b/ee/config/metrics/counts_7d/20210216182149_i_testing_web_performance_widget_total_weekly.yml index 01f3e8bdddad68..39172dff0fb637 100644 --- a/ee/config/metrics/counts_7d/20210216182149_i_testing_web_performance_widget_total_weekly.yml +++ b/ee/config/metrics/counts_7d/20210216182149_i_testing_web_performance_widget_total_weekly.yml @@ -8,7 +8,7 @@ product_stage: verify product_group: pipeline_execution product_category: web_performance value_type: number -status: active +status: removed time_frame: 7d data_source: redis_hll instrumentation_class: RedisHLLMetric @@ -22,3 +22,5 @@ tier: - ultimate performance_indicator_type: [] milestone: "<13.9" +milestone_removed: "15.11" +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/114018 diff --git a/ee/config/metrics/counts_7d/20210216182154_i_testing_load_performance_widget_total_weekly.yml b/ee/config/metrics/counts_7d/20210216182154_i_testing_load_performance_widget_total_weekly.yml index f4c3832d6013dd..b3b5505f1dd0cd 100644 --- a/ee/config/metrics/counts_7d/20210216182154_i_testing_load_performance_widget_total_weekly.yml +++ b/ee/config/metrics/counts_7d/20210216182154_i_testing_load_performance_widget_total_weekly.yml @@ -8,7 +8,7 @@ product_stage: verify product_group: pipeline_execution product_category: load_testing value_type: number -status: active +status: removed time_frame: 7d data_source: redis_hll instrumentation_class: RedisHLLMetric @@ -22,3 +22,5 @@ tier: - ultimate performance_indicator_type: [] milestone: "<13.9" +milestone_removed: "15.11" +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/114018 -- GitLab From 79771badef9da0cf258c578dedee9ca120eceb0b Mon Sep 17 00:00:00 2001 From: Thomas Randolph Date: Thu, 23 Mar 2023 16:18:07 -0600 Subject: [PATCH 3/5] Remove deprecated MR widget events from known events --- .../ee/gitlab/usage_data_counters/known_events/common.yml | 6 ------ lib/gitlab/usage_data_counters/known_events/common.yml | 2 -- 2 files changed, 8 deletions(-) diff --git a/ee/lib/ee/gitlab/usage_data_counters/known_events/common.yml b/ee/lib/ee/gitlab/usage_data_counters/known_events/common.yml index 25e2823c82c35e..779e4a0cb57293 100644 --- a/ee/lib/ee/gitlab/usage_data_counters/known_events/common.yml +++ b/ee/lib/ee/gitlab/usage_data_counters/known_events/common.yml @@ -11,14 +11,8 @@ aggregation: weekly - name: i_testing_group_code_coverage_visit_total aggregation: weekly -- name: i_testing_load_performance_widget_total - aggregation: weekly - name: i_testing_metrics_report_artifact_uploaders aggregation: weekly -- name: i_testing_metrics_report_widget_total - aggregation: weekly -- name: i_testing_web_performance_widget_total - aggregation: weekly - name: i_search_advanced aggregation: weekly - name: i_search_paid diff --git a/lib/gitlab/usage_data_counters/known_events/common.yml b/lib/gitlab/usage_data_counters/known_events/common.yml index f5973587ebb911..d3520961665bfb 100644 --- a/lib/gitlab/usage_data_counters/known_events/common.yml +++ b/lib/gitlab/usage_data_counters/known_events/common.yml @@ -62,8 +62,6 @@ # Testing category - name: i_testing_test_case_parsed aggregation: weekly -- name: i_testing_summary_widget_total - aggregation: weekly - name: i_testing_test_report_uploaded aggregation: weekly - name: i_testing_coverage_report_uploaded -- GitLab From 238498ffdeedbfebf947727ef6f89b1cc095d7f0 Mon Sep 17 00:00:00 2001 From: Thomas Randolph Date: Thu, 23 Mar 2023 17:12:33 -0600 Subject: [PATCH 4/5] Remove metrics marked as "removed" from aggregate metrics --- ...20210216183209_i_testing_paid_monthly_active_user_total.yml | 3 --- ...20210216183219_i_testing_paid_monthly_active_user_total.yml | 3 --- 2 files changed, 6 deletions(-) diff --git a/ee/config/metrics/counts_28d/20210216183209_i_testing_paid_monthly_active_user_total.yml b/ee/config/metrics/counts_28d/20210216183209_i_testing_paid_monthly_active_user_total.yml index 97d28c409fd191..d012c471608985 100644 --- a/ee/config/metrics/counts_28d/20210216183209_i_testing_paid_monthly_active_user_total.yml +++ b/ee/config/metrics/counts_28d/20210216183209_i_testing_paid_monthly_active_user_total.yml @@ -17,11 +17,8 @@ options: operator: OR attribute: user_id events: - - 'i_testing_web_performance_widget_total' - 'i_testing_full_code_quality_report_total' - 'i_testing_group_code_coverage_visit_total' - - 'i_testing_load_performance_widget_total' - - 'i_testing_metrics_report_widget_total' distribution: - ee tier: diff --git a/ee/config/metrics/counts_7d/20210216183219_i_testing_paid_monthly_active_user_total.yml b/ee/config/metrics/counts_7d/20210216183219_i_testing_paid_monthly_active_user_total.yml index 400f81a6f5b5a4..b1c7df18a8331d 100644 --- a/ee/config/metrics/counts_7d/20210216183219_i_testing_paid_monthly_active_user_total.yml +++ b/ee/config/metrics/counts_7d/20210216183219_i_testing_paid_monthly_active_user_total.yml @@ -17,11 +17,8 @@ options: operator: OR attribute: user_id events: - - 'i_testing_web_performance_widget_total' - 'i_testing_full_code_quality_report_total' - 'i_testing_group_code_coverage_visit_total' - - 'i_testing_load_performance_widget_total' - - 'i_testing_metrics_report_widget_total' distribution: - ee tier: -- GitLab From 9419e6416d900622c5b18138b5478cfceae7e704 Mon Sep 17 00:00:00 2001 From: Thomas Randolph Date: Mon, 27 Mar 2023 13:12:58 -0600 Subject: [PATCH 5/5] Remove deprecated events from mixed removed metrics --- .../20210216184140_testing_total_unique_counts_monthly.yml | 4 ---- .../20210216184138_testing_total_unique_counts_weekly.yml | 4 ---- 2 files changed, 8 deletions(-) diff --git a/config/metrics/counts_28d/20210216184140_testing_total_unique_counts_monthly.yml b/config/metrics/counts_28d/20210216184140_testing_total_unique_counts_monthly.yml index 9c8ce1a1f06d4a..c7667b902f2c64 100644 --- a/config/metrics/counts_28d/20210216184140_testing_total_unique_counts_monthly.yml +++ b/config/metrics/counts_28d/20210216184140_testing_total_unique_counts_monthly.yml @@ -13,14 +13,10 @@ instrumentation_class: RedisHLLMetric options: events: - i_testing_test_case_parsed - - i_testing_metrics_report_widget_total - i_testing_group_code_coverage_visit_total - i_testing_full_code_quality_report_total - - i_testing_web_performance_widget_total - i_testing_group_code_coverage_project_click_total - - i_testing_load_performance_widget_total - i_testing_metrics_report_artifact_uploaders - - i_testing_summary_widget_total - users_expanding_testing_code_quality_report - users_expanding_testing_accessibility_report distribution: diff --git a/ee/config/metrics/counts_7d/20210216184138_testing_total_unique_counts_weekly.yml b/ee/config/metrics/counts_7d/20210216184138_testing_total_unique_counts_weekly.yml index f1c63b3b48e168..b54ed62dd04502 100644 --- a/ee/config/metrics/counts_7d/20210216184138_testing_total_unique_counts_weekly.yml +++ b/ee/config/metrics/counts_7d/20210216184138_testing_total_unique_counts_weekly.yml @@ -13,14 +13,10 @@ instrumentation_class: RedisHLLMetric options: events: - i_testing_test_case_parsed - - i_testing_metrics_report_widget_total - i_testing_group_code_coverage_visit_total - i_testing_full_code_quality_report_total - - i_testing_web_performance_widget_total - i_testing_group_code_coverage_project_click_total - - i_testing_load_performance_widget_total - i_testing_metrics_report_artifact_uploaders - - i_testing_summary_widget_total - users_expanding_testing_code_quality_report - users_expanding_testing_accessibility_report distribution: -- GitLab