-
Notifications
You must be signed in to change notification settings - Fork 380
Added LogBuffering validation. #729
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
Conversation
…ul error in case the LogBuffering is not configured according to https://docs.aws.amazon.com/lambda/latest/dg/telemetry-api.html\#telemetry-api-buffering
calavera
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the improvements. I left you a couple of small suggestions if you want to make the code a little bit cleaner.
lambda-extension/src/extension.rs
Outdated
| let log_buffering_validation_result = validate_buffering_configuration(self.log_buffering); | ||
| if log_buffering_validation_result.is_err() { | ||
| return log_buffering_validation_result; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you can just do this, no need to use the result explicitly.
| let log_buffering_validation_result = validate_buffering_configuration(self.log_buffering); | |
| if log_buffering_validation_result.is_err() { | |
| return log_buffering_validation_result; | |
| } | |
| validate_buffering_configuration(self.log_buffering)?; |
lambda-extension/src/extension.rs
Outdated
| let telemetry_buffering_validation_result = validate_buffering_configuration(self.telemetry_buffering); | ||
| if telemetry_buffering_validation_result.is_err() { | ||
| return telemetry_buffering_validation_result; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you can just do this, no need to use the result explicitly.
| let telemetry_buffering_validation_result = validate_buffering_configuration(self.telemetry_buffering); | |
| if telemetry_buffering_validation_result.is_err() { | |
| return telemetry_buffering_validation_result; | |
| } | |
| validate_buffering_configuration(self.log_buffering)?; |
The validation will provide a meaningful error in case the
LogBufferingis not configured according to telemetry-api-buffering docs.Issue #, if available:
Description of changes:
Updated the
LogBufferingstruct in. Added validation and unit tests. Also update therunmethod of the extension to utilize the validation and return an error if applicable.By submitting this pull request