Skip to content

plugin_proxy: add config map to the plugin registration#12058

Open
iypetrov wants to merge 1 commit into
fluent:masterfrom
iypetrov:extend-flb-plugin-register-to-accept-a-schema
Open

plugin_proxy: add config map to the plugin registration#12058
iypetrov wants to merge 1 commit into
fluent:masterfrom
iypetrov:extend-flb-plugin-register-to-accept-a-schema

Conversation

@iypetrov

@iypetrov iypetrov commented Jul 6, 2026

Copy link
Copy Markdown

Extend the proxy plugin registration flow so input and output Go plugins can attach a flb_config_map schema, enabling the same property validation native plugins already receive. Custom plugins are excluded because they don't go through the property-check callback path. For more context can check this discussion.

Issue #11776


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-test label to test for all targets (requires maintainer to do).

Documentation

  • Documentation required for this feature

Backporting

  • 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.

Summary by CodeRabbit

  • Bug Fixes
    • Plugin registration now carries plugin configuration settings through correctly for both input and output plugins.
    • This improves consistency when loading plugins that rely on custom configuration options.

Signed-off-by: Ilia Petrov <ilia.yavorov.petrov@gmail.com>
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a config_map field to struct flb_plugin_proxy_def in the plugin proxy header, and propagates that field into created output and input plugin instances during proxy registration in flb_plugin_proxy.c. A comment describing the registration process is also updated.

Changes

Proxy Config Map Propagation

Layer / File(s) Summary
Config map struct field
include/fluent-bit/flb_plugin_proxy.h
Adds a config_map pointer member to struct flb_plugin_proxy_def.
Registration wiring
src/flb_plugin_proxy.c
Sets out->config_map and in->config_map from the proxy definition during output/input plugin registration, and updates a related comment.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Poem

A rabbit hops through proxy code,
Carrying a map along the road,
Config now travels, field to field,
No longer hidden, no longer sealed,
Output and input, both in tow. 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding config map support to plugin registration.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@iypetrov iypetrov changed the title plugin_proxy: add config map arg to the plugin registration plugin_proxy: add config map to the plugin registration Jul 6, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a2aacd87b2

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

char *name; /* plugin short name */
char *description; /* plugin description */
int event_type; /* event type (logs/metrics/traces) */
struct flb_config_map *config_map; /* plugin's configuration */

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Propagate proxy config maps to custom plugins

When a Go proxy registers as FLB_PROXY_CUSTOM_PLUGIN and sets this new field, it is dropped because flb_proxy_register_custom() only copies flags/name/description into struct flb_custom_plugin. The custom path does have config-map validation (flb_custom_plugin_property_check() gates on p->config_map), so those plugins will silently accept unknown properties and won't get defaults/dynamic-env handling even though input/output proxy plugins do.

Useful? React with 👍 / 👎.

@iypetrov

iypetrov commented Jul 6, 2026

Copy link
Copy Markdown
Author

@cosmo0920 @edsiper

@iypetrov

iypetrov commented Jul 9, 2026

Copy link
Copy Markdown
Author

@cosmo0920 when you have time, can you rerun the failing tests?

@iypetrov

iypetrov commented Jul 9, 2026

Copy link
Copy Markdown
Author

@edsiper this PR implements the suggestion from #11788 (comment) - when this one got merged, I will close the PR with previous implementation in fluent-bit repo and will start working on the required change in fluent-bit-go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant