Skip to content

Comments

feat: sync upstream Fluent Bit from v4.0.11 to upstream/4.0#18

Closed
niedbalski wants to merge 8 commits intomainfrom
sync/upstream-4.0.12
Closed

feat: sync upstream Fluent Bit from v4.0.11 to upstream/4.0#18
niedbalski wants to merge 8 commits intomainfrom
sync/upstream-4.0.12

Conversation

@niedbalski
Copy link
Contributor

@niedbalski niedbalski commented Oct 3, 2025

Summary

Syncs FluentDo Agent with upstream Fluent Bit from v4.0.11 to upstream/4.0

This PR applies upstream patches to keep FluentDo Agent in sync with Fluent Bit while preserving our customizations.

Changes Applied

Technical Fixes & Improvements

  • 383d7ad: in_emitter: Resolve ring buffer gtliches on threaded mode
  • a4718f1: opentelemetry: logs: skip empty strings for TraceID and
  • b187885: in_splunk: return correct error response for http/1
  • ac8f949: in_splunk: return correct error response for http/1

Test Updates

  • d23ab7b: in_forward: tests: Add a regression test case for
  • da52b34: tests: internal: opentelemetry: add tests for empty

Upstream Reference

Testing Checklist

  • Build passes (cd source && cmake . && make)
  • Unit tests pass
  • No regressions in FluentDo features
  • Security hardening preserved
  • Custom plugins functional

FluentDo Customizations Verified

  • Branding remains intact
  • Version scheme correct (YY.MM.PATCH)
  • Custom features working
  • Package naming preserved

Type of Change

  • Bug fix (non-breaking change fixing an issue)
  • Enhancement (non-breaking change adding functionality)
  • Breaking change (would cause existing functionality to not work as expected)

Generated by scripts/create-sync-pr.sh

Greptile Overview

Updated On: 2025-10-03 06:15:48 UTC

Summary

This PR synchronizes the FluentDo Agent with upstream Fluent Bit, incorporating changes from version v4.0.11 to the upstream/4.0 branch. FluentDo Agent is a downstream distribution of Fluent Bit that maintains its own customizations while staying current with upstream improvements.

The changes primarily focus on bug fixes and reliability improvements across several core components:

  • Ring Buffer Threading Fix: Resolves initialization issues in the emitter input plugin's threaded mode by improving collector creation error handling and simplifying threaded mode detection logic
  • OpenTelemetry Compliance: Enhances OpenTelemetry logs processing to properly handle empty trace and span IDs, treating them as optional fields rather than invalid data
  • Splunk HEC Error Handling: Fixes critical HTTP response logic in the Splunk input plugin to return correct status codes based on payload processing results
  • Testing Infrastructure: Adds regression tests for both the forward input threading issues and OpenTelemetry empty ID handling
  • Sync Tooling Enhancement: Improves the upstream sync script to handle commit SHA references in addition to version tags

The synchronization process updates the version tracking marker from 'v4.0.11' to 'upstream/4.0', indicating alignment with the latest upstream branch rather than a specific release tag. This approach allows FluentDo to incorporate the most recent fixes while maintaining their custom patches through their established sync workflow.

All changes are backward compatible and focus on fixing edge cases and improving reliability rather than introducing new features. The modifications preserve FluentDo's customizations while bringing in essential stability improvements from the upstream Fluent Bit project.

Important Files Changed

Changed Files
Filename Score Overview
source/plugins/in_emitter/emitter.c 4/5 Fixes ring buffer initialization in threaded mode with improved error handling
source/src/opentelemetry/flb_opentelemetry_logs.c 4/5 Enhances OpenTelemetry compliance by handling empty trace/span IDs gracefully
source/plugins/in_splunk/splunk_prot.c 4/5 Fixes critical HTTP response logic to return correct status codes
source/tests/runtime/in_forward.c 4/5 Adds regression test for threaded forward input with multiline processing
source/tests/internal/data/opentelemetry/test_cases.json 5/5 Adds test case for empty trace/span ID handling validation
source/oss_version.txt 5/5 Updates version tracking from v4.0.11 to upstream/4.0
scripts/sync-upstream-patches.sh 4/5 Enhances sync script to handle commit SHA references

Confidence score: 4/5

  • This PR is generally safe to merge with good bug fixes and testing coverage
  • Score reflects solid technical improvements with comprehensive test coverage for the main fixes
  • Pay close attention to the HTTP response logic changes in the Splunk plugin and threading fixes in the emitter plugin

Sequence Diagram

sequenceDiagram
    participant User
    participant "Sync Script" as Script
    participant "Upstream Repo" as Upstream
    participant "Source Files" as Source
    participant "Tests" as Tests

    User->>Script: "Run sync-upstream-patches.sh --from v4.0.11 --to upstream/4.0"
    Script->>Upstream: "Fetch upstream commits"
    Script->>Script: "Generate patch files"
    Script->>Script: "Categorize patches (TECHNICAL, TESTS, etc.)"
    Script->>User: "Show patch analysis"
    User->>Script: "Confirm apply patches"
    Script->>Source: "Apply emitter ring buffer fix"
    Script->>Source: "Apply splunk error response fixes"
    Script->>Source: "Apply OpenTelemetry empty string validation"
    Script->>Tests: "Add regression test for forward issue 10946"
    Script->>Tests: "Add OpenTelemetry empty string tests"
    Script->>Source: "Update oss_version.txt to upstream/4.0"
    Script->>User: "Sync complete - ready for PR"
Loading

Upstream-Ref: fluent/fluent-bit@00388b3
Cherry-picked from Fluent Bit upstream/4.0
Upstream-Ref: fluent/fluent-bit@0e09599
Cherry-picked from Fluent Bit upstream/4.0
Upstream-Ref: fluent/fluent-bit@48afea2
Cherry-picked from Fluent Bit upstream/4.0
Upstream-Ref: fluent/fluent-bit@3dd39d8
Cherry-picked from Fluent Bit upstream/4.0
Synced patches from Fluent Bit v4.0.11 to upstream/4.0
Signed-off-by: Jorge Niedbalski <jnr@metaklass.org>
@niedbalski niedbalski requested a review from a team October 3, 2025 06:15
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

7 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

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

Labels

build-windows Option to enable building of Windows packages only for a PR to test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant