Collect system data for client monitoring #5182
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Follow up PR for #5037 to implement collection of system data to support full feature set of beaconcha.in monitoring app.
Description
Replaces currently hard-coded values in system stats with proper provider functions. Most of the system data is collected using systeminformation which is a widely used and well maintained package with 0 dependencies. There are a few issues running in a containerized environment as some data might be inaccurate or missing but the important data is collected correctly even there. These issues might also be addressed in the future, see sebhildebrandt/systeminformation#777, although it is really not that important.
Performance
Dashboards are already in place to keep track of the performance. The functions to collect system data are not executed in the main thread and a lot of the time use child processes which execute native system calls depending on OS. The performance measurements from the last few days looks really promising and I did not see any issues as of now both validator efficiency and system load seem unaffected by enabling client monitoring.
Added some screenshots of prometheus metrics, just let me now if I should provide further metrics.
Prometheus metrics
Beaconcha.in mobile app
We support all dashboards in the beaconcha.in mobile app and also all notifications which is the most valuable feature of the app in my opinion. A node operator gets a lot of value from the app which you normally would only get if you run prometheus + grafana and invest additional time to configure proper alerting.
Mobile app screenshots