-
Notifications
You must be signed in to change notification settings - Fork 545
in_http: add_remote_addr #2130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
in_http: add_remote_addr #2130
Conversation
esmerel
left a comment
There was a problem hiding this 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.
bc93bab to
867a1fb
Compare
patrick-stephens
left a comment
There was a problem hiding this 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.
|
hi @aletourneau we're ready to merge the code PR and this one. Thanks for your contribution! |
Yes, wasn't aware there was a conflict, I'll take a look, thank you for notifying me. |
867a1fb to
17cb08f
Compare
WalkthroughAdds a new Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested labels
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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. Comment |
|
@lecaros The conflict is now resolved. |
There was a problem hiding this 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
📒 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_addrto 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-Forheaders, showing how thehttp2config affects which value is used. The table comparinghttp2config values to the resultingREMOTE_ADDRvalue 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.
17cb08f to
55e9682
Compare
|
Note: addressed the capitalization concern raised by coderabbitai |
esmerel
left a comment
There was a problem hiding this 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.
pipeline/inputs/http.md
Outdated
| curl -d '{"key1":"value1","key2":"value2"}' -XPOST -H "content-type: application/json" http://localhost:8888/app.log | ||
| ``` | ||
|
|
||
| ### Add remote addr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ### Add remote addr | |
| ### Add a remote address |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
pipeline/inputs/http.md
Outdated
| curl -d '{"key1":"value1"}' -XPOST -H 'Content-Type: application/json' -H 'X-Forwarded-For: host1, host2' http://localhost:8888 | ||
| ``` | ||
|
|
||
| However, if your system sets multiple `X-Forwarded-For` headers in the request, the one used (first, or last) depends on the value of the `http2` config. For example: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| However, if your system sets multiple `X-Forwarded-For` headers in the request, the one used (first, or last) depends on the value of the `http2` config. For example: | |
| However, if your system sets multiple `X-Forwarded-For` headers in the request, the one used (first, or last) depends on the value of the `http2` configuration. For example: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will fix that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed config to parameter since http2 is a parameter of the in_http plugin. I feel this is even more specific.
pipeline/inputs/http.md
Outdated
|
|
||
| The value of REMOTE_ADDR will be: | ||
|
|
||
| | http2 config | value of REMOTE_ADDR | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| | http2 config | value of REMOTE_ADDR | | |
| | HTTP/2 config | Value of `REMOTE_ADDR` | |
http/2 is still going to throw a spelling error, but it appears to be the proper noun version of the product name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The configuration option is actually called http2 (cf: line 13) so, from my point of view this should not be changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: the config there, could be changed to configuration though, so at least that wouldn't register as a warning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed http2 config to http2 parameter and added back ticks around REMOTE_ADDR
55e9682 to
5b47a8a
Compare
Signed-off-by: Alexandre Létourneau <letourneau.alexandre@gmail.com>
5b47a8a to
897138d
Compare
Corresponds to: fluent/fluent-bit#11080
Summary by CodeRabbit
New Features
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.