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

enhancement(aws_cloudwatch_logs sink): Enforce age requirements #2437

Merged
merged 11 commits into from
Apr 30, 2020
Merged

Conversation

ktff
Copy link
Contributor

@ktff ktff commented Apr 24, 2020

Closes #1483

Open questions

  • Regarding

    or older than the retention period of the log group

    part of the second constraint I'm unsure in how to deal with it?
    Actually implementing this would somewhat complicate the sink, for a case which would happen rarely. If this isn't added, in the worst case aws may drop that batch which would have a limited effect since we are splitting the batches into 24h pieces. And dropping older messages also shouldn't be a problem since there is already a precedent of dropping messages older than 14 days. (EDIT: filtering on 14day should be enough)

@ktff ktff added the sink: aws_cloudwatch_logs Anything `aws_cloudwatch_logs` sink related label Apr 24, 2020
@ktff ktff requested a review from LucioFranco April 24, 2020 10:20
@ktff ktff self-assigned this Apr 24, 2020
@ktff ktff changed the title Aws req enhancement(aws_cloudwatch_logs sink): Enforce age requirements Apr 24, 2020
@binarylogic
Copy link
Contributor

Thanks @ktff. Just confirming, performance-wise does anything jump out here that might reduce that?

@ktff
Copy link
Contributor Author

ktff commented Apr 25, 2020

@binarylogic The sort we introduced in #2320 , which I just moved in this PR to another location, it could on larger batches. It helps that in most cases messages will be almost sorted.

Other than that, there is an additional passage over messages for splitting them into 24h batches, but I now see that we can optimize it and introduce a fast path for majority case.

@binarylogic
Copy link
Contributor

Perfect, thanks!

Signed-off-by: ktf <krunotf@gmail.com>
Signed-off-by: Kruno Tomola Fabro <krunotf@gmail.com>
Signed-off-by: Kruno Tomola Fabro <krunotf@gmail.com>
Signed-off-by: Kruno Tomola Fabro <krunotf@gmail.com>
Signed-off-by: Kruno Tomola Fabro <krunotf@gmail.com>
Copy link
Contributor

@LucioFranco LucioFranco left a comment

Choose a reason for hiding this comment

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

Looks like a good start, but I have a few questions. Let me know if you have any questions.

src/sinks/aws_cloudwatch_logs/mod.rs Outdated Show resolved Hide resolved
src/sinks/aws_cloudwatch_logs/mod.rs Outdated Show resolved Hide resolved
src/sinks/aws_cloudwatch_logs/mod.rs Show resolved Hide resolved
src/sinks/aws_cloudwatch_logs/request.rs Outdated Show resolved Hide resolved
Signed-off-by: Kruno Tomola Fabro <krunotf@gmail.com>
Signed-off-by: Kruno Tomola Fabro <krunotf@gmail.com>
Signed-off-by: Kruno Tomola Fabro <krunotf@gmail.com>
@ktff ktff requested a review from LucioFranco April 29, 2020 11:48
Copy link
Contributor

@LucioFranco LucioFranco left a comment

Choose a reason for hiding this comment

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

Ok, looks great to me! I'd be curious if we can add a bit more test coverage around the splitting logic.

src/sinks/aws_cloudwatch_logs/mod.rs Show resolved Hide resolved
src/sinks/aws_cloudwatch_logs/mod.rs Outdated Show resolved Hide resolved
Signed-off-by: Kruno Tomola Fabro <krunotf@gmail.com>
Signed-off-by: Kruno Tomola Fabro <krunotf@gmail.com>
Signed-off-by: Kruno Tomola Fabro <krunotf@gmail.com>
@ktff ktff merged commit d28a176 into master Apr 30, 2020
binarylogic pushed a commit that referenced this pull request Apr 30, 2020
* Time filtering

Signed-off-by: ktf <krunotf@gmail.com>

* Add 24h split

Signed-off-by: Kruno Tomola Fabro <krunotf@gmail.com>

* Add test

Signed-off-by: Kruno Tomola Fabro <krunotf@gmail.com>

* Fix remainder range

Signed-off-by: Kruno Tomola Fabro <krunotf@gmail.com>

* Add optimization

Signed-off-by: Kruno Tomola Fabro <krunotf@gmail.com>

* Remove extra buffer time

Signed-off-by: Kruno Tomola Fabro <krunotf@gmail.com>

* Move filtering to outer layer

Signed-off-by: Kruno Tomola Fabro <krunotf@gmail.com>

* Fix

Signed-off-by: Kruno Tomola Fabro <krunotf@gmail.com>

* Add split_off

Signed-off-by: Kruno Tomola Fabro <krunotf@gmail.com>

* Add 24h split test

Signed-off-by: Kruno Tomola Fabro <krunotf@gmail.com>

* Bump

Signed-off-by: Kruno Tomola Fabro <krunotf@gmail.com>
@binarylogic binarylogic deleted the aws_req branch July 23, 2020 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sink: aws_cloudwatch_logs Anything `aws_cloudwatch_logs` sink related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ensure the cloudwatch_logs sink follows event requirements
3 participants