Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to mute all errors (mainly due to access rights) coming f…
…rom process scraper of the hostmetricsreceiver (open-telemetry#34981) **Description:** We are currently encountering an issue with the `process` scraper in the `hostmetricsreceiver`, primarily due to access rights restrictions for certain processes like system processes for example. This is resulting in a large number of verbose error logs. Most of them are coming from the `process.open_file_descriptors` metric but we have errors coming from other metrics as well. In order to solve this issue, we added a flag `mute_process_all_errors `that mutes errors comming from the process scraper metrics, as these errors are predominantly associated with processes that we should not be monitoring anyways. **Link to tracking Issue:** open-telemetry#20435 **Testing:** Added unit tests **Documentation:** **Errors**: - Permission denied errors: ``` go.opentelemetry.io/collector/receiver@v0.90.1/scraperhelper/scrapercontroller.go:176 2024-09-02T17:24:10.341+0200 error scraping metrics {"kind": "receiver", "name": "hostmetrics/linux/localhost", "data_type": "metrics", "error": "error reading open file descriptor count for process \"systemd\" (pid 1): open /proc/1/fd: permission denied; ``` - File not found errors: ``` go.opentelemetry.io/collector/receiver@v0.90.1/scraperhelper/scrapercontroller.go:176 2024-09-02T17:25:38.688+0200 error scraperhelper/scrapercontroller.go:200 Error scraping metrics {"kind": "receiver", "name": "hostmetrics/process", "data_type": "metrics", "error": "error reading cpu times for process \"java\" (pid 466650): open /proc/466650/stat: no such file or directory; error reading memory info for process \"java\" (pid 466650): open /proc/466650/statm: no such file or directory; error reading thread info for process \"java\" (pid 466650): open /proc/466650/status: no such file or directory; error reading cpu times for process \"java\" (pid 474774): open /proc/474774/stat: no such file or directory; error reading memory info for process \"java\" (pid 474774): open /proc/474774/statm: no such file or directory; error reading thread info for process \"java\" (pid 474774): open /proc/474774/status: no such file or directory; error reading cpu times for process \"java\" (pid 481780): open /proc/481780/stat: no such file or directory; error reading memory info for process \"java\" (pid 481780): open /proc/481780/statm: no such file or directory; error reading thread info for process \"java\" (pid 481780): open /proc/481780/status: no such file or directory", "scraper": "process"} ``` **Config**: ``` receiver hostmetrics/process: collection_interval: ${PROCESSES_COLLECTION_INTERVAL}s scrapers: process: mute_process_name_error: true mute_process_exe_error: true mute_process_io_error: true mute_process_user_error: true resource_attributes: # disable non_used default attributes process.command: enabled: false process.command_line: enabled: false process.executable.path: enabled: false process.owner: enabled: false process.parent_pid: enabled: false metrics: # disable non-used default metrics process.cpu.time: enabled: false process.memory.virtual: enabled: false # enable used optional metrics process.cpu.utilization: enabled: true process.open_file_descriptors: enabled: true process.threads: enabled: true ```
- Loading branch information