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

[exporter/splunkhec] fix event size check #22834

Closed

Conversation

atoulme
Copy link
Contributor

@atoulme atoulme commented May 26, 2023

Description:
Fix the event size check associated with the max_event_size setting.

Link to tracking Issue:
Fixes #18066

Testing:
Changed unit test to match expectation.

Documentation:
N/A

@atoulme atoulme requested a review from a team May 26, 2023 22:39
@atoulme atoulme requested a review from dmitryax as a code owner May 26, 2023 22:39
@@ -61,7 +61,7 @@ func (b *bufferState) Close() error {

// accept returns true if data is accepted by the buffer
func (b *bufferState) accept(data []byte) (bool, error) {
if len(data)+b.rawLength > int(b.maxEventLength) {
if len(data) > int(b.maxEventLength) {
Copy link
Member

Choose a reason for hiding this comment

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

This will cause an unnecessary batch flush every time this is encountered. This check should not be inside the accept. Let's hold off on this for now. I'd like to simplify the compression logic first, which is dependent on this in some way.

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

Successfully merging this pull request may close these issues.

[exporter/splunkhec] Allow to drop log messages longer than a given max length
3 participants