-
Notifications
You must be signed in to change notification settings - Fork 1.8k
plugin_proxy: enable event_type specification for proxy plugins #11011
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
base: master
Are you sure you want to change the base?
plugin_proxy: enable event_type specification for proxy plugins #11011
Conversation
This commit 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. In the flb_plugin_proxy_register function default behaviour is enforced by checking for unset event_type vlaues. When unset (a value of 0) then log behaviour 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 dicates and future usecases using incorrect values can be treated as user error. Input use case does not use event-type and is unaffected by this change. Signed-off-by: jmccormick7 <[email protected]>
WalkthroughAdded a public Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant App as Plugin provider
participant Proxy as Plugin proxy
participant Core as Fluent Bit core
participant Out as Output instance
App->>Proxy: supply flb_plugin_proxy_def (event_type maybe 0)
Proxy->>Core: flb_proxy_register_output(def)
rect rgba(220,235,255,0.6)
note over Core: Output registration logic
Core->>Out: if def.event_type == 0\nset Out.event_type = FLB_OUTPUT_LOGS\nelse set Out.event_type = def.event_type
end
Core-->>Proxy: registration complete
sequenceDiagram
autonumber
participant App as Plugin provider
participant Proxy as Plugin proxy
participant Core as Fluent Bit core
participant In as Input instance
App->>Proxy: supply flb_plugin_proxy_def
Proxy->>Core: flb_proxy_register_input(def)
rect rgba(220,255,220,0.6)
note over Core: Input registration logic
Core->>Core: mk_list_add(In) into config.in_plugins
end
Core-->>Proxy: registration complete
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
… malloc Changing intialization to use calloc instead of malloc so that emtpy fields are 0 initialized. Specifically for the event_type addition. Signed-off-by: jmccormick7 <[email protected]>
This commit 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.
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 #10995
This PR enables the ability to allow Go plugins to register their event types PR 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:
If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
ok-package-test
label to test for all targets (requires maintainer to do).Documentation
Backporting
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
Bug Fixes
Chores