Skip to content

feat: add batch_size support to opentelemetry output plugin - #2015

Open
mvitz wants to merge 1 commit into
fluent:masterfrom
mvitz:feat-otel-output-batch-size
Open

feat: add batch_size support to opentelemetry output plugin#2015
mvitz wants to merge 1 commit into
fluent:masterfrom
mvitz:feat-otel-output-batch-size

Conversation

@mvitz

@mvitz mvitz commented Jul 24, 2026

Copy link
Copy Markdown

What this PR does / why we need it:

It adds the batch_size option for the OpenTelemetry output plugin.

Does this PR introduced a user-facing change?

Add batchSize int32 option to opentelemetry output plugin.

Additional documentation, usage docs, etc.:


@joshuabaird
joshuabaird requested a review from Copilot July 28, 2026 14:20

Copilot AI 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.

Pull request overview

Note

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Adds batchSize configuration support for the Fluent Bit OpenTelemetry output plugin across the API type, generated CRDs, Helm chart CRDs, and user documentation.

Changes:

  • Introduces batchSize (*int32) to the OpenTelemetry output plugin API and maps it to Fluent Bit’s batch_size key.
  • Updates CRD schemas (bases, rendered manifests, and chart CRDs) to include the new field.
  • Updates plugin documentation and extends unit tests to cover the new parameter.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
manifests/setup/setup.yaml Adds batchSize to rendered CRD manifests so clusters can validate the new field.
docs/plugins/fluentbit/output/open_telemetry.md Documents the new batchSize option in the OpenTelemetry output plugin page.
config/crd/bases/fluentbit.fluent.io_outputs.yaml Adds batchSize schema to the Output CRD base.
config/crd/bases/fluentbit.fluent.io_clusteroutputs.yaml Adds batchSize schema to the ClusterOutput CRD base.
charts/fluent-operator/crds/fluentbit.fluent.io_outputs.yaml Propagates batchSize schema into the Helm chart CRDs for Outputs.
charts/fluent-operator/crds/fluentbit.fluent.io_clusteroutputs.yaml Propagates batchSize schema into the Helm chart CRDs for ClusterOutputs.
charts/fluent-operator-fluent-bit-crds/templates/fluentbit.fluent.io_outputs.yaml Updates the fluent-bit CRD chart template schema for Outputs.
charts/fluent-operator-fluent-bit-crds/templates/fluentbit.fluent.io_clusteroutputs.yaml Updates the fluent-bit CRD chart template schema for ClusterOutputs.
apis/fluentbit/v1alpha2/plugins/output/open_telemetry_types_test.go Extends unit test expectations to include batch_size.
apis/fluentbit/v1alpha2/plugins/output/open_telemetry_types.go Adds BatchSize field and inserts batch_size into generated Fluent Bit config KVs.
Files not reviewed (1)
  • apis/fluentbit/v1alpha2/plugins/output/zz_generated.deepcopy.go: Generated file
Comments suppressed due to low confidence (1)

manifests/setup/setup.yaml:1

  • This field is added in several generated CRD artifacts (bases, rendered manifests, and multiple Helm chart CRDs/templates). To reduce drift risk, prefer making the change in the single source of truth (Go type + controller-gen markers) and regenerating all CRD outputs, rather than maintaining the same schema snippet across multiple files.

| tls | | *[plugins.TLS](../tls.md) |
| networking | Include fluentbit networking options for this output-plugin | *[plugins.Networking](../net.md) |
| totalLimitSize | Limit the maximum number of Chunks in the filesystem for the current output logical destination. | string |
| batchSize | Set the maximum number of log records to be flushed at a time, default `1000` | *int32 |
Comment on lines +49 to +50
// Set the maximum number of log records to be flushed at a time.
BatchSize *int32 `json:"batchSize,omitempty"`
@joshuabaird

joshuabaird commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

@mvitz Thanks for the contribution. Couple things:

The Basic test and verify CI job is failing on the "Ensure all generated code is committed" step because docs/plugins/fluentbit/output/open_telemetry.md was hand-edited to add , default 1000``, but that doc is auto-generated from the Go struct comment.

The doc generator (go run ./cmd/doc-gen/main.go) regenerates the row from the BatchSize field comment in apis/fluentbit/v1alpha2/plugins/output/open_telemetry_types.go, which does not contain the default text, so regeneration produces a diff and the check fails.

To fix, add the default to the Go struct comment so it propagates consistently:

// Set the maximum number of log records to be flushed at a time, default `1000`
BatchSize *int32 `json:"batchSize,omitempty"`

Then run the generate target (e.g. make manifests docs) and commit the regenerated files. Alternatively, drop , default 1000`` from the doc line so it matches the generated output.

Signed-off-by: Michael Vitz <michael.vitz@innoq.com>
@mvitz
mvitz force-pushed the feat-otel-output-batch-size branch from a3e3463 to 497913e Compare July 28, 2026 17:54
@mvitz

mvitz commented Jul 28, 2026

Copy link
Copy Markdown
Author

@joshuabaird thanks for the help. I dropped the mentioned default value from the docs because it's the implicit default of fluentbit itself and therefore should be clear without mentioning it within the operators doc.
I also added the suggestet validation from copilot and set it to a minimum of zero as this allows to force using the default value of fluentbit.
Everything was force pushed because I don't think a separate commit would have given any value.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants