NSM Wiki: Add unique user counter for wiki page and design views with Usage Ping
Summary
In #218161 (closed) / !38784 (merged) we added Usage Ping tracking for wiki page views, but we're only counting the absolute number of page view events.
Proposal
Also track the number of unique users viewing wiki pages, in addition to creates/updates/deletes which are already tracked.
It looks like this is currently implemented in lib/gitlab/usage_data_counters/track_unique_events.rb
, which gets called automatically for all events that create an Event
record. We don't do that for page views, so we can probably just manually increase the counter at https://gitlab.com/gitlab-org/gitlab/-/blob/8b272bb8fddbfa23460bab54787f513eaddff8bf/app/controllers/concerns/wiki_actions.rb#L70.
Caveats
- We haven't implemented activity tracking for group wikis yet, so for those we'd only count the manually tracked views (and not creates/updates/deletes)
- In #218161 (closed) we're only tracking page views in the browser and not
GET
requests through the API.
Edited by Christen Dybenko