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

Add support for writing each batch of records as a CLP IR file; Replace Fluent Bit Go MessagePack decoder with our own implementation. #3

Merged
merged 37 commits into from
Jun 25, 2024

Conversation

davemarco
Copy link
Contributor

Description

Plugin can now retrieve chunks from the fluent-bit engine and encode them as compressed IR. After encoding, the plugin will write the chunk to a local file. I added the following files:

  • decoder.go to fix the msgpack string decoding issue mentioned in the last PR
  • ir.go to help with conversion to IR

The next step is to send this same chunk to S3.

single key

A fluent-bit record is a JSON-like object, and while CLP can parse JSON into IR it is not recommended. To resolve this issue, the user can specify a key, and the plugin will look for the key in the fluent-bit record, and output the key's value instead of the whole record. Typically, fluent-bit configurations with no parser setup will have the key "log" in the record containing the unstructured log, so the user should specify the key "log" to convert their unstructured logs into IR. As a fallback for logs missing a key, and for users who do want to compress parsed JSON, the plugin does support converting the entire JSON record.

warning

Do not run this development version for long durations. It will generate a small file every second to your local system.

Validation performed

Confirmed that CLP package can compress and search the compressed IR outputted by the plugin

@davemarco davemarco changed the title Encode records as zstd compressed IR and write each batch to a separate file. Encode records as zstd compressed IR and writes each batch to a separate file. Jun 14, 2024
@kirkrodrigues kirkrodrigues requested a review from davidlion June 14, 2024 16:51
@davemarco
Copy link
Contributor Author

reverted context back to config since wasn't being used

Copy link
Member

@davidlion davidlion left a comment

Choose a reason for hiding this comment

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

Some small tweaks to doc strings / comments.

@davemarco davemarco requested a review from davidlion June 25, 2024 16:43
@davemarco davemarco requested a review from davidlion June 25, 2024 20:28
Copy link
Member

@davidlion davidlion left a comment

Choose a reason for hiding this comment

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

Add support for writing each batch of records as a CLP IR file; Replace Fluent Bit Go MessagePack decoder with our own implementation.

@davidlion davidlion changed the title Encode records as zstd compressed IR and writes each batch to a separate file. Add support for writing each batch of records as a CLP IR file; Replace Fluent Bit Go MessagePack decoder with our own implementation. Jun 25, 2024
@davidlion davidlion merged commit d79e399 into y-scope:main Jun 25, 2024
2 checks passed
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.

2 participants