Convert Redis metrics for package to Internal Events - pull events
requested to merge 424893-convert-redis-metrics-for-group-package-and-registry-to-internal-events into master
What does this MR do and why?
Migrates all pull_package
-metrics to use Internal Events instead.
A new event (pull_package_from_registry
) is defined and all the pull metrics are migrated to use that event.
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.
How to set up and validate locally
To test this, we will create a generic package, then pull it and verify that all relevant metrics gets updated.
- Create a file echo "abc" > /tmp/foo.txt
- Create a generic package
curl --header "PRIVATE-TOKEN: <TOKEN>" --upload-file /tmp/foo.txt \ "http://gdk.test:3000/api/v4/projects/<project_id>/packages/generic/my_package/0.0.1/file.txt"
- Start the monitor by running:
rails runner scripts/internal_events/monitor.rb pull_package_from_registry
- Pull the package
curl --header "PRIVATE-TOKEN: <TOKEN>" \ "http://gdk.test:3000/api/v4/projects/<proect_id>/packages/generic/my_package/0.0.1/file.txt"
- Use the monitor to see that all relevant metrics were updated. In this case it is
counts.package_events_i_package_generic_pull_package
,counts.package_events_i_package_pull_package
andcounts.package_events_i_package_pull_package_by_user
- Verify that the generated Snowplow event looks correct in the monitor
Related to #424893 (closed)
Edited by Jonas Larsen