-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make /proc/pid/io lookup failures skippable (#129)
## What does this PR do? This fixes a change in the behavior of the system metrics where fetching process metrics on a container without `SYS_PTRACE` results in a failure, as `/proc/pid/io` requires `SYS_PTRACE`. This flies under the radar in a handful of use cases, as our docs mention `SYS_PTRACE` in other contexts, and many users monitoring system data will (in my experience) end up passing `--privileged` due to [a variety of issues with permissions in `proc`](https://stackoverflow.com/questions/56573990/access-to-full-proc-in-docker-container). This issue also doesn't appear outside of docker. There is a test already that does cover this (although it'll catch it for a permissions error, not a container capability error): `TestFetchProcessFromOtherUser`, however, that test is usually skipped in CI, as the CI environment lacks more than one user. The exact test condition itself can't really be tested without running in a container. If we want to test this more thoroughly, we'll need some kind of integration test in beats that runs in a container and specifically looks out for skipped processes. These kinds of tests are often flaky, so they tend not to happen. Once we get buildkite set up in the beats repo, we should add a test that specifically looks for skipped metrics, probably by spinning up multiple sub-processes and having beats monitor them directly. ## Why is it important? This changes the behavior of system metrics inside a container. ## Checklist - [x] My code follows the style guidelines of this project - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have added an entry in `CHANGELOG.md`
- Loading branch information
1 parent
7f008f4
commit 709b5c4
Showing
4 changed files
with
107 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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