Skip to content

Conversation

@aletourneau
Copy link

@aletourneau aletourneau commented Oct 31, 2025

Corresponds to: fluent/fluent-bit#11080

Summary by CodeRabbit

  • New Features

    • Added add_remote_addr option to the HTTP input (default: false) to populate a REMOTE_ADDR field from X-Forwarded-For, with handling for single vs. multiple headers and HTTP/2 selection semantics.
  • Documentation

    • Updated HTTP input docs with configuration guidance, YAML/conf examples, and multiple curl test commands demonstrating add_remote_addr behavior across different X-Forwarded-For scenarios.

✏️ Tip: You can customize this high-level summary in your review settings.

Copy link
Contributor

@esmerel esmerel left a comment

Choose a reason for hiding this comment

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

My suggestions are stylistic for page consistency. They're fairly minor. This looks good to me otherwise, but should have a technical review for final approval.

@aletourneau aletourneau force-pushed the in_http/add_remote_addr branch from bc93bab to 867a1fb Compare November 3, 2025 21:07
@eschabell eschabell added the waiting-on-review Waiting on a review from mainteners label Nov 4, 2025
@eschabell eschabell self-assigned this Nov 4, 2025
Copy link
Contributor

@patrick-stephens patrick-stephens left a comment

Choose a reason for hiding this comment

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

Seems ok, waiting on code merge.

@patrick-stephens patrick-stephens removed the waiting-on-review Waiting on a review from mainteners label Nov 5, 2025
@eschabell eschabell added 4.2.1 conflict Waiting on conflict to be resolved by contributor and removed 4.2.1 labels Dec 3, 2025
@lecaros
Copy link
Contributor

lecaros commented Dec 18, 2025

hi @aletourneau we're ready to merge the code PR and this one. Thanks for your contribution!
Could you please resolve the conflict?

@aletourneau
Copy link
Author

hi @aletourneau we're ready to merge the code PR and this one. Thanks for your contribution! Could you please resolve the conflict?

Yes, wasn't aware there was a conflict, I'll take a look, thank you for notifying me.

@aletourneau aletourneau force-pushed the in_http/add_remote_addr branch from 867a1fb to 17cb08f Compare December 18, 2025 18:58
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 18, 2025

📝 Walkthrough

Walkthrough

Adds a new add_remote_addr (default: false) configuration option to the HTTP input docs, describing how REMOTE_ADDR is derived from X-Forwarded-For (handling of single vs. multiple headers and HTTP/2), and adds example fluent-bit.yaml / fluent-bit.conf snippets plus curl tests.

Changes

Cohort / File(s) Summary
HTTP Input Documentation
pipeline/inputs/http.md
Adds add_remote_addr config (default: false); documents selection from single vs. multiple X-Forwarded-For headers and HTTP/2 behavior; inserts YAML and conf examples showing add_remote_addr, includes curl examples demonstrating behavior.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

I'm a rabbit in docs, nibbling code with cheer,
I added REMOTE_ADDR so requests draw near.
With X-Forwarded-For I hop to the right,
YAML and curl make the field take flight.
🐇✨

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'in_http: add_remote_addr' directly and clearly summarizes the main change—adding a new add_remote_addr configuration option to the HTTP input plugin documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 897138d and efc76ac.

📒 Files selected for processing (1)
  • pipeline/inputs/http.md
🔇 Additional comments (3)
pipeline/inputs/http.md (3)

8-10: Configuration table entry is clear and well-placed.

The add_remote_addr parameter is properly documented in the table with a concise description that clearly explains its purpose and default value.


45-69: "Add a remote address field" section is well-structured and informative.

The section provides:

  • Clear explanation of the feature
  • Practical curl examples showing single and multiple X-Forwarded-For headers
  • A helpful table illustrating how the http2 parameter affects which header value is used

The documentation effectively explains the behavior without being verbose.


191-207: YAML example is properly formatted and consistent.

Both the indentation and parameter naming (lowercase add_remote_addr) follow the document's YAML conventions correctly.


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 and usage tips.

@aletourneau
Copy link
Author

@lecaros The conflict is now resolved.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4e21b77 and 17cb08f.

📒 Files selected for processing (1)
  • pipeline/inputs/http.md (3 hunks)
🔇 Additional comments (3)
pipeline/inputs/http.md (3)

8-19: Configuration table looks good.

The addition of add_remote_addr to the configuration parameters table is well-documented with a clear description and correct default value.


45-70: Documentation of add_remote_addr feature is clear and well-structured.

The explanation effectively covers the single header case and demonstrates the behavior with multiple X-Forwarded-For headers, showing how the http2 config affects which value is used. The table comparing http2 config values to the resulting REMOTE_ADDR value is helpful.


191-230: Configuration examples and curl test command are helpful.

The YAML and CONF format examples (aside from the capitalization issue flagged separately) and the curl test command provide good practical guidance for users wanting to enable this feature.

Once you fix the CONF format capitalization issue on lines 212–217, please verify that the examples work end-to-end with the corresponding code changes in the fluent-bit repository PR.

@aletourneau aletourneau force-pushed the in_http/add_remote_addr branch from 17cb08f to 55e9682 Compare December 18, 2025 19:11
@aletourneau
Copy link
Author

Note: addressed the capitalization concern raised by coderabbitai

Copy link
Contributor

@esmerel esmerel left a comment

Choose a reason for hiding this comment

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

some minor stylistic suggestions to reduce vale complaints.

curl -d '{"key1":"value1","key2":"value2"}' -XPOST -H "content-type: application/json" http://localhost:8888/app.log
```

### Add remote addr
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
### Add remote addr
### Add a remote address

Copy link
Author

Choose a reason for hiding this comment

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

Not entirely sure about this one, because the header/section is aiming at documenting a configuration parameter called "add_remote_addr", so changing it to "add a remote address", might confuse the users... thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe ### Use add_remote_addr ? - that'd keep the info while getting rid of the vale complaint

Copy link
Author

Choose a reason for hiding this comment

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

I went with your initial suggestion, and also changed configuration option to configuration parameter to be more consistent across the board.

cf:

-### Add remote addr
+### Add a remote address field
 
-The `add_remote_addr` configuration option, when activated, adds a `REMOTE_ADDR` field to the records. The value of `REMOTE_ADDR` is the client's address, which is extracted from the `X-Forwarded-For` header.
+The `add_remote_addr` configuration parameter, when activated, adds a `REMOTE_ADDR` field to the records. The value of `REMOTE_ADDR` is the client's address, which is extracted from the `X-Forwarded-For` header.

@aletourneau aletourneau force-pushed the in_http/add_remote_addr branch 2 times, most recently from 5b47a8a to 897138d Compare December 22, 2025 22:25
Copy link
Member

@alexakreizinger alexakreizinger left a comment

Choose a reason for hiding this comment

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

I left one additional formatting suggesting, but pending that, giving my stamp of approval here since @esmerel is AFK for the next week :)

Signed-off-by: Alexandre Létourneau <[email protected]>
@aletourneau aletourneau force-pushed the in_http/add_remote_addr branch from 897138d to efc76ac Compare January 5, 2026 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflict Waiting on conflict to be resolved by contributor waiting-on-code-merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants