Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds additional diagnostics to the Cisco networkinterface collector to help investigate cases where interface byte counters are unexpectedly reported as zero/missing.
Changes:
- Adds presence checks for
eth_inbytes/eth_outbytesduring interface parsing. - Introduces a
debugMissingByteshelper that logs an error and appends the raw CLI JSON output to a local debug file.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| filename := "/tmp/interface_debug.txt" | ||
| f, err := os.OpenFile(filename, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0600) | ||
| if err != nil { |
There was a problem hiding this comment.
debugMissingBytes appends output.String() (the full CLI response) to a hard-coded /tmp file. This can quickly create very large, unbounded files and adds disk I/O on the collection path; it may also fail in containers/locked-down environments where /tmp is read-only. Consider gating this behind a config/env flag and logging only the relevant per-interface JSON (or a small subset) to the normal logger instead of writing to disk, or use os.TempDir()/configurable path with rotation/limits.
No description provided.