Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ship a final batch of logs before shutdown #1822

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pkg/sendbuffer/sendbuffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ func (sb *SendBuffer) Run(ctx context.Context) error {
case <-sb.sendTicker.C:
continue
case <-ctx.Done():
// Send one final batch, if possible, so that we can get logs related to shutdowns
time.Sleep(1 * time.Second)
RebeccaMahany marked this conversation as resolved.
Show resolved Hide resolved
if err := sb.sendAndPurge(); err != nil {
sb.logger.Log("msg", "failed to send final batch of logs on shutdown", "err", err)
}
return nil
}
}
Expand Down
Loading