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
- Enable the widget feature flag:
Feature.enable(:refactor_mr_widgets_extensions)
- Configure your project so that a widget appears
- 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. import testWidget from './extensions/issues';
-
registerExtension(testWidget);
(at bottom ofinitWidget
)
- The easiest way to do this is to import the test widget into
- When the page loads, confirm that the
_view
and_count_view
events are sent to the backend - Expand the widget. Confirm that the
_expand
and_count_expand
events are sent to the backend - 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
- For example, if the widget is showing a warning icon, the events should end with
- 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.
-
I have evaluated the MR acceptance checklist for this MR.