Skip to content

Add redis hll user event tracking for resource link clicks on frontend

What does this MR do and why?

This MR implements frontend tracking for Linked resources feature.

Relates to #368597 (closed)

Screenshots or screen recordings

NA

How to set up and validate locally

  1. Make sure you have GitLab Premium
  2. Enable feature flag incident_resource_links_widget on rails console using `Feature.enable(:incident_resource_links_widget)
  3. Open a project where you have atleast reporter permissions.
  4. Open or create an incident in Monitor > Incidents
  5. Check the Linked resources widget in the Summary tab.
  6. Run Gitlab::UsageDataCounters::HLLRedisCounter.unique_events(event_names: 'incident_management_issuable_resource_link_visited', start_date: Date.current.beginning_of_week, end_date: Date.current.next_week) in the rails console.
  7. Check that the value is 0.
  8. Add a resource link from the UI on Linked resources section.
  9. Click on that link. (It's fine if the link does not lead anywhere).
  10. Run the command from step 6 again in the rails console.
  11. See the value getting incremented from 0 to 1.

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

Edited by Rajendra Kadam

Merge request reports