Skip to content

plugin_proxy: add config map to the plugin registration - #12058

Open
iypetrov wants to merge 2 commits 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 2 commits 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

Summary by CodeRabbit

  • Bug Fixes
    • Plugin registration now correctly propagates plugin configuration settings when creating proxy-based input, output, and custom plugins.
    • This improves consistency for plugins that depend on custom configuration data during initialization.

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

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1464a107-5dc7-43ee-aa48-79cae589c5a0

📥 Commits

Reviewing files that changed from the base of the PR and between a2aacd8 and d40d032.

📒 Files selected for processing (1)
  • src/flb_plugin_proxy.c

📝 Walkthrough

Walkthrough

Adds config_map to flb_plugin_proxy_def and propagates it to output, input, and custom plugin instances during proxy registration. A related registration comment is also updated.

Changes

Proxy Config Map Propagation

Layer / File(s) Summary
Struct field and registration wiring
include/fluent-bit/flb_plugin_proxy.h, src/flb_plugin_proxy.c
Adds the config_map pointer to flb_plugin_proxy_def and assigns it to output, input, and custom plugin proxy instances during registration. Updates a related comment.

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

Suggested reviewers: edsiper

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding config map support to plugin proxy registration.
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.
✨ 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 👍 / 👎.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@iypetrov We need to apply the same operation which is like copying config_map on the proxy of custom plugins. So, could you add copying operation line into flb_proxy_register_custom() as well?

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

@iypetrov

Copy link
Copy Markdown
Author

@cosmo0920 @edsiper this PR is related to the discussion we had here.

@cosmo0920 cosmo0920 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Mostly, I like this idea more than the previous one. One thing, we need to align the registration in each of plugin types. So, could you add the similar diffs in custom plugins' proxy?

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
Contributor

Choose a reason for hiding this comment

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

@iypetrov We need to apply the same operation which is like copying config_map on the proxy of custom plugins. So, could you add copying operation line into flb_proxy_register_custom() as well?

@iypetrov

iypetrov commented Jul 30, 2026

Copy link
Copy Markdown
Author

Mostly, I like this idea more than the previous one. One thing, we need to align the registration in each of plugin types. So, could you add the similar diffs in custom plugins' proxy?

Thanks for the feedback, I will make the adjustments.

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

Copy link
Copy Markdown
Author

@cosmo0920 when you have time can you rerun the failing test, I think it is a flake

@iypetrov
iypetrov requested a review from cosmo0920 July 31, 2026 11:26
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.

2 participants