Make snowplow tracking optional in Gitlab::InternalEvents.track_event
Problem
Currently, In Gitlab::InternalEvents.track_event
we are calling redishll and snowplow events.
However, when frontend calls Internal Events from https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/assets/javascripts/tracking/internal_events.js, it has already called snowplow. So in that case we should not be calling snowplow from the backend.
Reference - #424389 (comment 1566929393)
Desired Outcome
When track_event
API is called, make snowplow call optional for Gitlab::InternalEvents.track_event
Potential Solution
We can expose a boolean shouldCallSnowplow?
which by default will be true and based on its value only snowplow tracking should be called. track_event
will pass false for it on calling Gitlab::InternalEvents.track_event