in_node_exporter_metrics: fix netstat file reads - #12173
Merged
Merged
Conversation
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughUpdated ChangesNetstat procfs reads
Estimated code review effort: 1 (Trivial) | ~2 minutes Possibly related PRs
Suggested reviewers: ✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 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. Comment |
edsiper
marked this pull request as ready for review
July 29, 2026 17:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Linux builds fail in the node exporter netstat collector because two
ne_utils_file_read_lines()calls still use the old three-argument signature. The helper now requires the plugin context before the mount and path arguments.Change
Pass
ctxto the/net/netstatand/net/snmp6reads, matching the existing/net/snmpcall and every other node exporter caller.This restores compilation and preserves contextual plugin error logging for those files.
Validation
cmake -S . -B build -DFLB_DEV=on -DFLB_TESTS_RUNTIME=On -DFLB_TESTS_INTERNAL=Oncmake --build build -j8 --target flb-plugin-in_node_exporter_metricscmake --build build -j8node_exporter_metricsnetstat smoke run against the host/proc; IPv4, TcpExt/IpExt, and IPv6 metrics were emitted.git diff --checkThere is currently no node exporter pytest or CTest scenario in-tree for this compile-time regression.
Summary by CodeRabbit