-
Notifications
You must be signed in to change notification settings - Fork 15
Add process minimum age to filter out short lived processes if needed #194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add process minimum age to filter out short lived processes if needed #194
Conversation
Thanks for your contribution @corneliu-calciu ! I have one question: what happens if a long-lived process starts while Beyla is running? Beyla will get the notice of that new process but it will detect it as too young, so will it discard it? |
Hi Mario This is exactly the scenario I want to address. The Beyla PODs are already running. A new process will be created on a node. Best Regards |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good already, I left a few comments that I think we should address. Thanks for working on this!!!
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #194 +/- ##
===========================================
- Coverage 75.23% 43.15% -32.08%
===========================================
Files 177 170 -7
Lines 19167 18574 -593
===========================================
- Hits 14420 8016 -6404
- Misses 3997 9901 +5904
+ Partials 750 657 -93
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I looked at the test failures, I think we need to extend our default timeout interval since it takes a bit longer now for the services to be instrumented. These functions:
in test_utils.go (integration tests). Right now we wait a minute, I think we should make that a constant and change it to 2 minutes. |
Hm, it looks like the problem is somewhere else, I'm going to take a look myself, but I can't before Tuesday next week. |
Thanks @corneliu-calciu for the reply!
But imagine a new long-lived process is created (e.g. a web server). Beyla gets the notification of a new process/port, then before deciding whether it has to be instrumented, checks the age of the process, and since it's very recent, the process will be discarded. So our new web server is never instrumented. Am I right, or am I missing something? |
Hi Mario The process scanning is a periodical activity. Basically the same process will be ignored in the first 5 seconds, and once will pass the minimum age will be handled. Best Regards |
So as you noticed, there's a problem with the new port event, since those are async and reported by eBPF, but @corneliu-calciu added a check to accept the process regardless of the age if the event was port open. |
Added minimum process age to be considered for discovery.
The new process detection logic will ignore a new process until its age reach a minimum value. As an example we may set a 3 seconds threshold as part of the monitoring configuration.
Any process will be considered as suitable for monitoring once is passing that configurable limit.
The noise of short lived processes can be filtered out.
Configuration example:
discovery:
exclude_services:
services:
min_process_age: 5s
Moved the RP from grafana/beyla#2066