cloudius-systems / osv

OSv, a new operating system for the cloud.
osv.io
Other
4.12k stars 605 forks source link

Expose more monitoring information via pseudo-fs files #1205

Open wkozaczuk opened 2 years ago

wkozaczuk commented 2 years ago

Even now some of the information (not necessarily monitoring) is presented using the procfs or fairly recently added sysfs filesystem (see 28350928d2465fcf5466f42984d86948d913adc2 and 2847b2a0449d01b129627e6a96b2005094b5461a). But a lot of such information is provided by the httpserver-api module and its read-only "cousin" - httpserver-monitoring-api which expose many HTTP endpoints returning information in JSON. There are some downsides to this approach:

Where am I going with this? It would be nice to expose the information which currently httpserver-api retrieves by directly invoking C or still C++ symbols in form of the pseudo-files under /proc or /sys. The advantage of this approach is that any app even in Java would be able to read relevant pseudo-file and utilize it for monitoring. And httpserver-api does not need new endpoints to present new information - one could use the existing /file? endpoint to read the relevant pseudo file. In the future, we could implement an even smaller and "dummer" http module that would only know how to return the content of the files from /proc and /sys and allow for monitoring that way.

Obviously, we would want to use the standard Linux paths for at least some of this information, but if it is OSv specific enough, we would put those under /sys/osv/.