plugin_proxy: enable event_type specification for proxy plugins (4.2 Backport)
This PR adds event_type to the flb_plugin_proxy_def struct. This allows for the setting of event_type to a value other than the default log only initialization.
This PR is a backport for FluentBit 4.2 that matches the approved changes in PR #11011
In the flb_plugin_proxy_register function default behavior is enforced by checking for unset event_type values. When unset (a value of 0) then log behavior is defaulted. No need for incorrect value checking since this was not a set field in the past. Unset fields are set as current behavior dictates and future use cases using incorrect values can be treated as user error.
Input use case does not use event-type and is unaffected by this change.
Addresses https://github.com/fluent/fluent-bit/issues/10995
This corresponding PR in the fluent-bit-go library enables the ability to allow Go plugins to register their event types https://github.com/fluent/fluent-bit-go/pull/80
Enter [N/A] in the box, if an item is not applicable to your change.
Testing Before we can approve your change; please submit the following in a comment:
- [ ] Example configuration file for the change
- [ ] Debug log output from testing the change
- [ ] Attached Valgrind output that shows no leaks or memory corruption was found
If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
- [ ] Run local packaging test showing all targets (including any new ones) build.
- [ ] Set
ok-package-testlabel to test for all targets (requires maintainer to do).
Documentation
- [ ] Documentation required for this feature
Backporting
- [ x] Backport to latest stable release.
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.
[!IMPORTANT]
Review skipped
Auto reviews are disabled on base/target branches other than the default branch.
Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.
✨ Finishing touches
🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
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 @coderabbitai help to get the list of available commands and usage tips.
@cosmo0920 I added this and one other pr (back porting to 4.1). I saw that the main pr was added to the 5.0 milestone. I just wanted to ask about the possibility of getting the back port in an earlier release for 4.2 as this is backwards compatible. I completely understand if it's preferred to wait until a major release as it is a feature change. I just figured it was worth checking in on to see if it could get released sooner. I'm more than happy to do anything additional that may be needed to support this if there's anything missing or areas where this falls short. Thanks!