Internal Events should send events Product Analytics only once
Problem
Currently, in case an internal event is triggered on the frontend, both frontend and backend are sending API calls to product analytics which makes any total count value for these incorrect in any Product Analytics dashboard.
Backend: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/internal_events.rb?ref_type=heads#L37
The events can be differentiated by the platform
field in CH, which will be web
for FE and ruby-{version}
for BE. By design FE events will have more data (e.g. user-agent, url etc.) attached than BE.
Affected Events (Internal Events triggered on frontend)
user_viewed_cluster_configuration
i_code_review_saved_replies_create
merge_request_click_start_review_on_changes_tab
merge_request_click_add_to_review_on_changes_tab
p_analytics_ci_cd_pipelines
p_analytics_ci_cd_deployment_frequency
p_analytics_ci_cd_lead_time
i_code_review_saved_replies_use
i_code_review_saved_replies_use_in_mr
i_code_review_saved_replies_use_in_other
user_viewed_dashboard
user_created_custom_dashboard
user_edited_custom_dashboard
user_viewed_dashboard_designer
user_viewed_custom_dashboard
user_viewed_builtin_dashboard
user_viewed_visualization_designer
user_created_custom_visualization
exclude_anonymised_users
user_viewed_dashboard_list
value_streams_dashboard_metric_link_clicked
value_streams_dashboard_change_failure_rate_link_clicked
value_streams_dashboard_contributor_count_link_clicked
value_streams_dashboard_cycle_time_link_clicked
value_streams_dashboard_deployment_frequency_link_clicked
value_streams_dashboard_deploys_link_clicked
value_streams_dashboard_issues_completed_link_clicked
value_streams_dashboard_issues_link_clicked
value_streams_dashboard_lead_time_for_changes_link_clicked
value_streams_dashboard_lead_time_link_clicked
value_streams_dashboard_merge_request_throughput_link_clicked
value_streams_dashboard_time_to_restore_service_link_clicked
value_streams_dashboard_vulnerability_critical_link_clicked
value_streams_dashboard_vulnerability_high_link_clicked
i_analytics_dev_ops_adoption
i_analytics_dev_ops_score
insights_chart_item_clicked
insights_issue_chart_item_clicked
insights_merge_request_chart_item_clicked
user_viewed_instrumentation_directions
g_project_management_users_epic_issue_added_from_epic
click_create_confidential_mr_issues_list
click_create_mr_issues_list
click_new_merge_request_list
click_new_merge_request_empty_list
user_edited_cluster_configuration
Desired Outcome
We should be sending events triggered on the Frontend to Product Analytics only once like how we are doing it for snowplow events.
Proposed Solution
Remove the call to Product Analytics for events that have been triggered by the Frontend via the API.
How to verify
Affected events should only be counted once.