Skip to content

Finalize the default widget telemetry spike

What does this MR do and why?

For #362017 (closed)

Consider the description of !86409 (closed) for more context of the changes here.

What

This creates a generic telemetry framework for MR Widget extensions that should scale to any new widget, but also allow for arbitrary new tracking events to be added.

Existing hard-coded telemetry is swapped for the framework implementation.

Why

Please see !86409 (closed) for more of the why.

In short: widgets should have telemetry turned on by default without developers needing to interact, and there should be a baseline of data so we can see what is happening with each widget (and future ones). We need a generic way to report user actions on any of our widgets.

Screenshots or screen recordings

This is all backstage.

How to set up and validate locally

  1. Enable the widget feature flag: Feature.enable(:refactor_mr_widgets_extensions)
  2. Configure your project so that a widget appears
    1. The easiest way to do this is to import the test widget into mr_widget_options.vue and register it when the widget is initialized.
    2. import testWidget from './extensions/issues';
    3. registerExtension(testWidget); (at bottom of initWidget)
  3. When the page loads, confirm that the _view and _count_view events are sent to the backend
  4. Expand the widget. Confirm that the _expand and _count_expand events are sent to the backend
  5. Confirm that whichever icon is showing is also sent as a _expand_view_[TYPE] or _count_expand_view_[TYPE] event.
    • For example, if the widget is showing a warning icon, the events should end with _warning
  6. Click the full report button. Confirm that the _click_full_report and _count_click_full_report events are sent to the backend.

NB: Every widget has some "non-standard" events that begin with i_testing. You will also see these events go across the network to the API.

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 Thomas Randolph

Merge request reports

Loading