Skip to content

Draft: Copy counts.package_events_i_package_pull_package_by_guest to Snowplow

What does this MR do and why?

It resolves #382873 (closed) by logging a snowplow event when a package is pulled from a package repository anonymously.

The counts.package_events_i_package_pull_package_by_guest Service Ping metric is important to understand on a namespace level for Customer Service / Product Analytics, however insights on that level are not available for Service Ping therefore this metric needs to be mirrored with Snowplow event tracking.

Notice that the event only is logged when the route_hll_to_snowplow_phase3 feature flag is enabled.

Screenshots or screen recordings

Not relevant

How to set up and validate locally

Setup

  1. Enable the events mirroring feature flag
    Feature.enable(:route_hll_to_snowplow_phase3)
  2. Make sure you Snowplow Micro setup and running. (Guide)
  3. Create or find a public project and note the project number.
  4. Make sure you have a package you can pull. If you don't have one, you can create one like this:
    curl -X PUT --header "PRIVATE-TOKEN: <your_access_token>" \
      --data "bar" \
      "http://gdk.test:3000/api/v4/projects/<project_id>/packages/generic/my_package/0.0.1/foo.txt"

Test steps

  1. Download the package:
    curl "http://gdk.test:3000/api/v4/projects/<project_id>/packages/generic/my_package/0.0.1/foo.txt"
  2. Check that the pull_package_by_guest event appears in Snowplow Micro.

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 #382873 (closed)

Merge request reports