node-exporter-textfile-collector-scripts icon indicating copy to clipboard operation
node-exporter-textfile-collector-scripts copied to clipboard

add xentop text collector script

Open oe1rfc opened this issue 4 years ago • 3 comments

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.

oe1rfc avatar Sep 19 '21 17:09 oe1rfc

Are you aware of https://github.com/bwesterb/go-xentop, which includes a sample Prometheus exporter?

dswarbrick avatar Mar 22 '23 14:03 dswarbrick

@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.

oe1rfc avatar Mar 22 '23 22:03 oe1rfc

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.

dswarbrick avatar Mar 22 '23 22:03 dswarbrick