Flush events once the number of events reach the limit
Set a limit on the number of accumulated events. Once reached, events should be flushed to rails. Currently we flush on a timer.
More context: https://gitlab.com/gitlab-com/dev-sub-department/section-dev-request-for-help/-/issues/199#note_1739522657
Proposal
- Limit the maximum number that the agent can send in a single API call to
/agent_events
. - If it reaches the limit, send events to Gitlab monolith.
- If it doesn't reach the limit, send events once the reporting period arrives.
Edited by Taka Nishida