-
Notifications
You must be signed in to change notification settings - Fork 22
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
[metric/system/process] - return errors encountered while monitoring set of processes #164
Comments
@VihasMakwana once this is implemented I believe it will work right away without any more changes required on the Beats side thanks to elastic/beats#40025 (review) right? |
We will need a small tweak here |
Well I guess we will have to create a new release of the elastic-agent-system-metrics but that was already part of the plan. |
## What does this PR do? - Previously, we weren't passing errors to the caller while monitoring set of processes. - With the recent introduction of the status reporter for metricsets, it is impossible to change the status to degraded if such errors are not passed to the caller. - Fix this by passing errors to the caller. We also populate the process related information to our best-effort. ## Checklist - [x] My code follows the style guidelines of this project - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have added tests that prove my fix is effective or that my feature works - [x] I have added an entry in `CHANGELOG.md` ## Manual testing and general information - See elastic/beats#40400 for testing it on `metricbeat` **NOTE**: - **Only applicable if you're using `system/process` module** - Non-fatal errors are only received when you have insufficient privileges. Steps: - While receiving any error, test for nature of error - call `errors.Is(err, NonFatalErr{}))` on received error - If true, error is non-fatal and you can proceed further (metrics will be partially available, most probably insufficient privileges). - Else, log the error and stop execution (metrics will be empty) Genreal info related to the changes in this PR: - While getting process related information, you might also receive a non-nil error. - Such errors come in two flavours: - Fatal errors: - This indicates that the error was fatal (for eg. `no process found`,) - Caller should stop further execution if they receive fatal errors - Non-fatal errors: - This indicates that the error was fatal (for eg. `not enough privileges`) - It means that metrics are partially filled. - Further execution can be continued if non-fatal errors are encountered - Closes #164
metricsets
, it is impossible to change the status to degraded if such errors are not passed to the caller.Proposed Solution
mutierr
to combine the important errors and pass it to caller with the metrics and let the caller decide what to do.Please share your thoughts on this!
cc: @cmacknz @pierrehilbert @jlind23
The text was updated successfully, but these errors were encountered: