in_node_exporter_metrics: Skip ipv6 metrics collection when disabled#11773
in_node_exporter_metrics: Skip ipv6 metrics collection when disabled#11773edsiper merged 1 commit intofluent:masterfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds filesystem existence checks for IPv6 sockstat in the Linux node exporter metrics plugin: includes system headers and updates sockstat_update() to construct the IPv6 procfs path, validate its length, call stat(), skip IPv6 collection on ENOENT, or proceed to read/parse when present. (50 words) ChangesIPv6 Availability Detection
Sequence Diagram(s)(Skipped — changes are a small availability check and do not introduce multi-component sequential control flow warranting a diagram.) Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2e0661eeb0
ℹ️ 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".
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@plugins/in_node_exporter_metrics/ne_sockstat_linux.c`:
- Around line 172-175: The ipv6_proc_path buffer is fixed at 32 bytes which can
truncate path_procfs and the code currently treats any stat() error as IPv6
disabled; change ipv6_proc_path to use PATH_MAX, after snprintf() verify the
returned length fits (detect truncation) and handle that as an error, call
stat() and only treat ENOENT as "IPv6 disabled" (set ipv6_enabled = 0); for any
other stat() failures propagate/allow ne_utils_file_read_lines() to handle and
log them rather than returning early; update references in this function to use
the new PATH_MAX-sized ipv6_proc_path and the ENOENT check.
🪄 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
Run ID: 9ea4c733-18f5-4fe5-b804-bd7aec72de7c
📒 Files selected for processing (1)
plugins/in_node_exporter_metrics/ne_sockstat_linux.c
The stat() pre-check on /proc/net/sockstat6 will avoid having lots of "no such file or directory" errors when trying to collect ipv6 metrics on hosts where ipv6 is disabled. Signed-off-by: Pierre-Yves Rofes <3604235+piwai@users.noreply.github.com>
2e0661e to
36ac632
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
thank you |
The stat() pre-check on /proc/net/sockstat6 will avoid having lots of "no such file or directory" errors when trying to collect ipv6 metrics on hosts where ipv6 is disabled.
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:
If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
ok-package-testlabel to test for all targets (requires maintainer to do).Documentation
Backporting
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