-
Notifications
You must be signed in to change notification settings - Fork 2
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
Upload batches of records to S3 instead of writing to file; Upgrade input validation using Go validator package. #4
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
davidlion
requested changes
Jul 1, 2024
…osed before uploading
kirkrodrigues
previously approved these changes
Jul 3, 2024
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.
Approving on behalf of @davidlion.
kirkrodrigues
previously approved these changes
Jul 4, 2024
davidlion
previously approved these changes
Jul 4, 2024
kirkrodrigues
approved these changes
Jul 4, 2024
davemarco
added a commit
to davemarco/fluent-bit-clp-fork
that referenced
this pull request
Jul 12, 2024
…nput validation using Go validator package. (y-scope#4)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Plugin can now send chunks to aws s3. In addition, the input validation has been heavily upgraded. Now supports default settings, optional settings, and input parsing. I also cleaned up READMEs and added a table for settings and defaults.
AWS S3
Plugin loads credentials using standard hierarchy described here
In addition to standard chain, I added the ability to assume a role. The fluent bit s3 plugin can do this, and I was already familiar with roles for clp cloud, so i added this feature.
I added some checks during startup to make sure credentials are good, and bucket exists . If checks fail, wont start collecting logs and will exit.
The file name is as follows: $bucketPrefix/$tag_$time_$ID.zst
The time is the system time in nanoseconds. the ID can be set by user, but if they leave it out, it is a UUID. This should help prevent collision if multiple collectors are sending to same path.
I removed file stuff, but may add back as another plugin later. In general, I think it is just useful for debugging and not having to send stuff to s3.
Input validation
Using go validator package to help with input validation. Fancier features being used are timezone and string parsing. Timezone checks if the IR timezone is a valid timezone. String parsing is being used to confirm role_arn has the correct prefix. More can be added later on.
There were some issues in that fluent-bit only supplies string type, and does not supply boolean type. Some of the code is confusing because of this, let me know if questions.
Validation performed