For Snowplow events Prometheus counter doesnt show correct amount of emitted events
## Problem We count Snowplow events successful and failed submission in the tracking class https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/tracking/destinations/snowplow.rb#L137 It was discovered that the `total` counter doesn't match `success + failures`. Total counter is approximately 10 time higher that the sum of the other two metrics. Given that we batch events by 10, its highly possible than Async Emitter isn't counter successful events submission correctly. https://dashboards.gitlab.net/d/analytics-instrumentation-main/d668a4a?orgId=1&from=now-7d&to=now%2Fm&timezone=utc&var-PROMETHEUS_DS=mimir-gitlab-gstg&var-environment=gstg&viewPanel=panel-4 ![image__2_](/uploads/82b4f5d5600fa2ff80daa41ea84a9613/image__2_.png) Callback in the snowplow library https://github.com/snowplow/snowplow-ruby-tracker/blob/master/lib/snowplow-tracker/emitters.rb#L276 ## Desired Outcome <!-- The desired state of the affected system after this issue has been completed --> ## Potential Solution <!-- An outline of potential solutions to get to the desired outcome. These solution(s) can still be adjusted throughout the implementation as long as the desired outcome is achieved. --> To check Async Emitter's hook to make sure we trigger the counter correctly. (i.e. in event invocation, not Emitter's execution. ### Documentation Update Needed <!-- Does this change require the documentation to be updated? check the appropriate option --> - [ ] Yes - [ ] No ## How to verify <!-- How can we verify that the desired outcome has been achieved? The instructions from this section should be used to move the issue from ~“worfklow::verification”. --> ## Further actions needed <!-- Any further tasks that need to be completed after the main work of the issue is done, such as announcing the changes. --> <!-- This section is optional. --> <!-- Make sure to add one of the type labels (as per https://handbook.gitlab.com/handbook/product/groups/product-analysis/engineering/metrics/#work-type-classification):--> <!-- /label ~"type::bug" ~"type::feature" ~"type::tooling" ~"type::maintenance" -->
issue