Skip to content

build: add options for plugins at group granularity - #12160

Open
RaJiska wants to merge 2 commits into
fluent:masterfrom
RaJiska:worktree-flb-minimal-groups
Open

build: add options for plugins at group granularity#12160
RaJiska wants to merge 2 commits into
fluent:masterfrom
RaJiska:worktree-flb-minimal-groups

Conversation

@RaJiska

@RaJiska RaJiska commented Jul 26, 2026

Copy link
Copy Markdown

Add FLB_ALL_INPUTS, FLB_ALL_PROCESSORS, FLB_ALL_FILTERS, and FLB_ALL_OUTPUTS options to control the build for each plugins group individually.

Three options for each variable:

  • Inherit: Default, doesn't do anything.
  • On: Plugins for the entire group enabled.
  • Off: Plugins for the entire group disabled.

Respects precedence from least to most specific (right overrides left):

  FLB_MINIMAL => FLB_ALL_* => Individual Option

e.g to disable everything except outputs and HTTP input:

  -DFLB_MINIMAL=On -DFLB_ALL_OUTPUTS=On -DFLB_IN_HTTP=On

The above configuration results in:

$ docker run --rm -it tmp /fluent-bit/bin/fluent-bit --help
[...]

Inputs
  http                    HTTP

Processors

Filters

Outputs
  azure                   Send events to Azure HTTP Event Collector
  azure_blob              Azure Blob Storage
  azure_logs_ingestion    Send logs to Log Analytics with Log Ingestion API
  azure_kusto             Send events to Kusto (Azure Data Explorer)
  bigquery                Send events to BigQuery via streaming insert
  counter                 Records counter
  datadog                 Send events to DataDog HTTP Event Collector
  es                      Elasticsearch
  exit                    Exit after a number of flushes (test purposes)
  file                    Generate log file
  forward                 Forward (Fluentd protocol)
  http                    HTTP Output
  influxdb                InfluxDB Time Series
  logdna                  LogDNA
  loki                    Loki
  kafka                   Kafka
  kafka-rest              Kafka REST Proxy
  nats                    NATS Server
  nrlogs                  New Relic
  null                    Throws away events
  opensearch              OpenSearch
  oracle_log_analytics    Oracle log analytics
  plot                    Generate data file for GNU Plot
  pgsql                   PostgreSQL
  retry                   Issue a retry upon flush request
  skywalking              Send logs into log collector on SkyWalking OAP
  slack                   Send events to a Slack channel
  splunk                  Send events to Splunk HTTP Event Collector
  stackdriver             Send events to Google Stackdriver Logging
  stdout                  Prints events to STDOUT
  syslog                  Syslog
  tcp                     TCP Output
  udp                     UDP Output
  td                      Treasure Data
  flowcounter             FlowCounter
  gelf                    GELF Output
  websocket               Websocket
  cloudwatch_logs         Send logs to Amazon CloudWatch
  kinesis_firehose        Send logs to Amazon Kinesis Firehose
  kinesis_streams         Send logs to Amazon Kinesis Streams
  opentelemetry           OpenTelemetry
  prometheus_exporter     Prometheus Exporter
  prometheus_remote_write Prometheus remote write
  s3                      Send to S3
  vivo_exporter           Vivo Exporter
  chronicle               Send logs to Google Chronicle as unstructured log

[...]

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
  • [N/A] Debug log output from testing the change
  • [N/A] 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.

  • [N/A] Run local packaging test showing all targets (including any new ones) build.
  • [N/A] Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • Documentation required for this feature

fluent/fluent-bit-docs#2632

Backporting

  • [N/A] 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

New Features

  • Added group-level controls for enabling or disabling all input, processor, filter, or output plugins.
  • Each group supports On, Off, or Inherit settings, allowing broad defaults while preserving individual plugin choices.
  • Explicitly configured plugin options remain unchanged when group defaults are applied.
  • Configuration values are validated to ensure only supported settings are accepted.

Add `FLB_ALL_INPUTS`, `FLB_ALL_PROCESSORS`, `FLB_ALL_FILTERS`, and
`FLB_ALL_OUTPUTS` options to control the build for each plugins group
individually.

Three options for each variable:
- `Inherit`: Default, doesn't do anything.
- `On`: Plugins for the entire group enabled.
- `Off`: Plugins for the entire group disabled.

Respects precedence from least to most specific (right overrides left):

  FLB_MINIMAL => FLB_ALL_* => Individual Option

e.g to disable everything except outputs and HTTP input:

  -DFLB_MINIMAL=On -DFLB_ALL_OUTPUTS=On -DFLB_IN_HTTP=On

Signed-off-by: Ra'Jiska <dodo.lasticot@gmail.com>
@coderabbitai

coderabbitai Bot commented Jul 26, 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: 886f829b-eef4-4ad8-b258-2754bce70ae7

📥 Commits

Reviewing files that changed from the base of the PR and between 577ae55 and 65f5cd5.

📒 Files selected for processing (1)
  • cmake/plugins_options.cmake
🚧 Files skipped from review as they are similar to previous changes (1)
  • cmake/plugins_options.cmake

📝 Walkthrough

Walkthrough

Changes

The CMake plugin options module adds validated On, Off, and Inherit controls for Inputs, Processors, Filters, and Outputs. It applies group settings while preserving explicitly pinned cache options.

Plugin group overrides

Layer / File(s) Summary
Define group override behavior
cmake/plugins_options.cmake
DEFINE_OPTION normalizes group overrides, preserves pinned options, tracks inherited values, and validates four group-level cache variables.
Wire overrides to plugin sections
cmake/plugins_options.cmake
Each plugin section assigns its group override before declarations, and the temporary variable is unset after Outputs.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: celalettin1286

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding build options for plugins at group granularity.
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.
✨ 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.

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cmake/plugins_options.cmake`:
- Around line 6-9: Update the plugin option setup around FLB_GROUP_OVERRIDE and
option() so inherited options are refreshed from the current group setting when
FLB_ALL_* changes during reconfiguration, while explicitly selected plugin
overrides remain unchanged. Ensure the cache-backed option is force-updated only
for inherited values, preserving the existing option_name, description, and
override behavior.
- Around line 16-23: The FLB_ALL_INPUTS, FLB_ALL_PROCESSORS, FLB_ALL_FILTERS,
and FLB_ALL_OUTPUTS cache variables currently accept arbitrary command-line
values. Validate each value immediately after its cache definition against
exactly On, Off, or Inherit, and call message(FATAL_ERROR ...) for any invalid
value before DEFINE_OPTION(...) or option() processing occurs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 366f0c78-ba9c-437d-88e0-d40f1720fa1c

📥 Commits

Reviewing files that changed from the base of the PR and between cb7256c and 52a64a1.

📒 Files selected for processing (1)
  • cmake/plugins_options.cmake

Comment thread cmake/plugins_options.cmake Outdated
Comment thread cmake/plugins_options.cmake

@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: 52a64a143c

ℹ️ 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".

Comment thread cmake/plugins_options.cmake Outdated
Comment on lines +16 to +19
set(FLB_ALL_INPUTS "Inherit" CACHE STRING "Enable/Disable all Input plugins (On, Off, Inherit)")
set(FLB_ALL_PROCESSORS "Inherit" CACHE STRING "Enable/Disable all Processor plugins (On, Off, Inherit)")
set(FLB_ALL_FILTERS "Inherit" CACHE STRING "Enable/Disable all Filter plugins (On, Off, Inherit)")
set(FLB_ALL_OUTPUTS "Inherit" CACHE STRING "Enable/Disable all Output plugins (On, Off, Inherit)")

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 Apply group settings after Windows defaults

On Windows with the default FLB_WINDOWS_DEFAULTS=On, these new controls do not govern most inputs, outputs, or filters: CMakeLists.txt:441-444 includes cmake/windows-setup.cmake later, whose lines 51-143 unconditionally reset many individual plugin variables. Consequently, for example, a fresh -DFLB_ALL_INPUTS=Off configuration still enables the default Windows inputs, while On still leaves several inputs disabled. Apply the group override after the platform defaults or make those defaults respect the selected group value.

AGENTS.md reference: AGENTS.md:L11-L15

Useful? React with 👍 / 👎.

@edsiper

edsiper commented Jul 29, 2026

Copy link
Copy Markdown
Member

thanks for the contribution, please resolve the issues reported by the AI review

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cmake/plugins_options.cmake`:
- Around line 17-30: Update the option inheritance logic in DEFINE_OPTION so an
unpinned option is marked pinned whenever its current value differs from
_FLB_INHERITED_${option_name}, before updating that inherited-value cache entry.
Preserve existing behavior for matching values and ensure later group changes do
not overwrite a diverged individual BOOL override.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 399d1db9-6f6b-4241-99fe-5d4b36e356de

📥 Commits

Reviewing files that changed from the base of the PR and between 52a64a1 and 577ae55.

📒 Files selected for processing (1)
  • cmake/plugins_options.cmake

Comment thread cmake/plugins_options.cmake
Signed-off-by: Ra'Jiska <dodo.lasticot@gmail.com>
@RaJiska
RaJiska force-pushed the worktree-flb-minimal-groups branch from 577ae55 to 65f5cd5 Compare August 1, 2026 13:46
@RaJiska

RaJiska commented Aug 1, 2026

Copy link
Copy Markdown
Author

Thank you @edsiper , fixed the issues.

I left the FLB_WINDOWS_DEFAULTS comment unaddressed as this issue doesn't stem from my changes, it seems like they've been there before. My understanding is that the the windows preset has been set to override whatever is configured either via FLB_MINIMAL, FLB_ALL, or even individual options. Probably something to be addressed in a separate PR? Although I suspect this may be by design.

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