Migrate symbol package metrics to internal events

What does this MR do and why?

Related to #424893 (closed)

This is the last stage of migrating package events, started with pull events migration.

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. On master branch, in the ruby console, trigger all the migrated events: %w[i_package_nuget_pull_symbol_package i_package_nuget_push_symbol_package i_package_pull_symbol_package i_package_pull_symbol_package_by_deploy_token i_package_pull_symbol_package_by_guest i_package_pull_symbol_package_by_user i_package_push_symbol_package i_package_push_symbol_package_by_deploy_token i_package_push_symbol_package_by_guest i_package_push_symbol_package_by_user].each {|ev| ::Gitlab::UsageDataCounters::PackageEventCounter.count(ev)}
  2. Calculate the metrics values: metrics = %w[counts.package_events_i_package_nuget_pull_symbol_package counts.package_events_i_package_nuget_push_symbol_package counts.package_events_i_package_pull_symbol_package counts.package_events_i_package_pull_symbol_package_by_deploy_token counts.package_events_i_package_pull_symbol_package_by_guest counts.package_events_i_package_pull_symbol_package_by_user counts.package_events_i_package_push_symbol_package counts.package_events_i_package_push_symbol_package_by_deploy_token counts.package_events_i_package_push_symbol_package_by_guest counts.package_events_i_package_push_symbol_package_by_user]; sp = Gitlab::Usage::ServicePing::InstrumentedPayload.new(metrics, :with_value).build
  3. Check out this MR's branch and reload! the console
  4. Make sure that all the metrics have the same values: sp2 = Gitlab::Usage::ServicePing::InstrumentedPayload.new(metrics, :with_value).build and then verify that sp == sp2 returns true
  5. Trigger all of the events again: %w[push_symbol_package_to_registry pull_symbol_package_from_registry].each {|e| %w[deploy_token guest user].each {|p| Gitlab::InternalEvents.track_event(e, additional_properties: { label: 'nuget', property: p })}}
  6. Generate new metric values sp3 = Gitlab::Usage::ServicePing::InstrumentedPayload.new(metrics, :with_value).build
  7. Make sure that all the metrics values have increased: sp3.values.first.map {|k, v| v > sp2[:counts][k]}.uniq should return [true]
Edited by Michał Wielich

Merge request reports

Loading