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

Flush the record buffer before the timespan of all records exceeds 24 hours #107

Merged
merged 2 commits into from
Nov 7, 2022

Conversation

jackwakefield
Copy link
Contributor

  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

This is a bug fix for #96, which occurs when calling PutLogEvents with records spanning more than 24 hours.

  • What is the current behavior? (You can also link to an open issue here)

The AWS SDK throws a CloudWatchLogsException with the message:

The batch of log events in a single PutLogEvents request cannot span more than 24 hours.

  • What is the new behavior (if this is a feature change)?

The CloudWatch handler will check whether a record's timestamp is more than 24 hours after the earliest timestamp, and if so calls PutLogEvents before adding the new record to the buffer.

  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

No

  • Other information:

N/A

… hours

This fixes the error "The batch of log events in a single PutLogEvents request cannot span more than 24 hours."
@coveralls
Copy link

coveralls commented Nov 7, 2022

Coverage Status

Coverage increased (+1.6%) to 91.346% when pulling f2f8fed on AlsoAsked:24-hour-timespan into 6433db0 on maxbanton:master.

@maxbanton maxbanton merged commit 4a655cd into maxbanton:master Nov 7, 2022
synace pushed a commit to Virtuvia/cwh that referenced this pull request Jan 17, 2023
… hours (maxbanton#107)

* Migrate the PHPUnit config to 9.3

* Flush the record buffer before the timespan of all records exceeds 24 hours

This fixes the error "The batch of log events in a single PutLogEvents request cannot span more than 24 hours."
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.

None yet

3 participants