Skip to content

Introduce log event buffering#2619

Merged
solnic merged 4 commits into
masterfrom
2613-log-buffering
May 7, 2025
Merged

Introduce log event buffering#2619
solnic merged 4 commits into
masterfrom
2613-log-buffering

Conversation

@solnic
Copy link
Copy Markdown
Collaborator

@solnic solnic commented May 6, 2025

Next step in our logging story - this adds a log event buffer, so that log events are buffered until they hit the limit set as a new config option called max_log_events, and then they are all packaged under the same envelope and sent right away.

Closes #2613

I tested it out and it works:

Screenshot 2025-05-06 at 15 56 11

#skip-changelog

@solnic solnic linked an issue May 6, 2025 that may be closed by this pull request
@solnic solnic requested review from AbhiPrasad and sl0thentr0py May 6, 2025 13:57
@solnic solnic marked this pull request as ready for review May 6, 2025 13:57
Copy link
Copy Markdown
Contributor

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@solnic solnic merged commit 27e3313 into master May 7, 2025
139 checks passed
@solnic solnic deleted the 2613-log-buffering branch May 7, 2025 05:54

def flush
@mutex.synchronize do
return unless size >= @max_events
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the case where someone adds only say 5 logs, these will never get sent, even at the exit flush

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what you want instead is

  • a periodic flush all the time
  • a force flush when the size exceeds while adding

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Log buffering

3 participants