log_event_encoder: add direct-emit path for FLUENT_BIT_V2 format#11431
log_event_encoder: add direct-emit path for FLUENT_BIT_V2 format#11431
Conversation
📝 WalkthroughWalkthroughAdds a direct-emit fast path in the log event encoder that, for FLUENT_BIT_V2 with metadata and body present, serializes and appends a compact MessagePack sequence [timestamp, metadata, body] directly into the main buffer; preserves the original root-buffer-based emission as a fallback. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1ad9cfc44a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
For FLUENT_BIT_V2 log format, emit_record can append the record as raw msgpack array bytes [ [timestamp, metadata], body ] directly to the main buffer instead of building it in the root buffer and then copying it. This avoids root buffer construction and one full-record copy per committed log record. The record is emitted without a msgpack string wrapper so the on-wire format matches the existing path and decoders that expect a root array continue to work. Estimated gain is on the order of 1–3% in the encoder hot path per record; Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
1ad9cfc to
f2b8890
Compare
For FLUENT_BIT_V2 log format, emit_record can append the record as raw msgpack array bytes [ [timestamp, metadata], body ] directly to the main buffer instead of building it in the root buffer and then copying it. This avoids root buffer construction and one full-record copy per committed log record.
The record is emitted without a msgpack string wrapper so the on-wire format matches the existing path and decoders that expect a root array continue to work.
Estimated gain is on the order of 1–3% in the encoder hot path per record;
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.
Summary by CodeRabbit