Forward snowplow events from frontend
What does this MR do and why?
This MR adds event forwarding configuration for the frontend client.
The configuration ensures that events from the frontend are sent to our backend endpoint instead of directly to Snowplow. This provides better control over which events are collected and forwarded.
When Snowplow tracking is disabled but collect_product_usage_events feature flag is enabled, frontend events will be routed through the backend using the EventForwardController. This is to allow us to forward Duo events and drop non-Duo events.
It's important to note that even though all events will be sent to the backend, they will only be forwarded if they are eligible according to EventEligibilityChecker.
Follow-up: From this thread we will be implementing an opimization to prevent unnecessary events from being sent to the backend: Prevent sending events to backend when product ... (#537957 - closed)
References
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
-
Enable the feature flag
collect_product_usage_events. -
Trigger an event in the frontend by opening or closing the sidebar.
-
Using dev tools in your browser, verify that events are sent to
/-/collect_events. -
Verify that the event is sent to Snowplow micro.
-
Disable the feature flag
collect_product_usage_events. -
Trigger an event in the frontend by opening or closing the sidebar.
-
Using dev tools in your browser, verify that events are sent directly to Snowplow Micro.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #525307 (closed)