node-exporter-textfile-collector-scripts
node-exporter-textfile-collector-scripts copied to clipboard
add xentop text collector script
This adds a script to parse the values of xentop as prometheus metrics.
gawk is probably needed for FPAT, which is used because xentop reports unset limits as no limit, which breaks whitespace-based field separation.
Are you aware of https://github.com/bwesterb/go-xentop, which includes a sample Prometheus exporter?
@dswarbrick I think at the time of writing this I was not aware of go-xentop, but I'm also not sure if it is still a maintained project since it depends on a prometheus/client_golang client release from 2019.
Personally I think that having to run a webserver as root on a virtualization host for statistics is not a good idea, but I can close this PR if there is no interest in it.
It would probably be pretty trivial to enhance go-xentop to optionally use sudo to call xentop, to avoid running the exporter as root.
Is there no way of getting machine-readable stats from Xen, e.g. in JSON format? Parsing the human-readable output of utils is often pretty fragile, as cosmetic changes to the output format can often break such approaches.