Skip to content

InternalEvents.track_event should be called with objects and not ids

Jonas Larsen requested to merge j_lar/fix-track-event into master

What does this MR do and why?

Events sent from the frontend to the /api/v4/usage_data/track_event endpoint did not get tracked in RedisHLL and therefor not in Service Ping.

See #424389 (closed) for context.

We are currently getting a lot of errors in Sentry due to this https://sentry.gitlab.net/gitlab/gitlabcom/?query=is%3Aunresolved+should+be+triggered+with+a+named+parameter

In this MR we start sending objects to InternalEvents.track_event instead of ids.

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. Check out `master``
  2. Start gdk redis-cli and reset the most recent weekly Redis hll key for the i_analytics_dev_ops_adoption event DEL "{hll_counters}_i_analytics_dev_ops_adoption-2023-38"
  3. Go to http://gdk.test:3000/admin/dev_ops_reports and open the dev tools
  4. Click the "Dev" tab
  5. See that track_event fails
  6. Check that PFCOUNT "{hll_counters}_i_analytics_dev_ops_adoption-2023-38" returns 0 in the Redis CLI.
  7. Switch to this branch
  8. Click the "Overview" tab and back to the "Dev" tab.
  9. Verify that track_event succeeds.
  10. Check that PFCOUNT "{hll_counters}_i_analytics_dev_ops_adoption-2023-38" returns 1 in the Redis CLI.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Jonas Larsen

Merge request reports