Track fallback-to-default-org event only once per transaction
What does this MR do and why?
When we can't derive an Organization, we fall back to the default organization. Since this should not happen, we track these fallbacks using fallback_current_organization_to_default event.
After deploying !226038 (merged), the number of events increased dramatically, causing issues in Snowplow Events processing.
The root cause was that we now need to check Current.organization in internal Rails SQL caching. This led to huge increase of events
This MR will change the behaviour of this: instead of tracking the event each and every time Current.organization is inspected, we only track it once per transaction
Currently, this tracking is behind a feature flag that is disabled.
References
Related to #598994 (closed)
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.