Freebsd create statistics as a command-line application which writes statistics in prometheus format.
https://www.freebsd.org/cgi/man.cgi?query=prometheus_sysctl_exporter
The output of the program on the commandline looks like this,
HTTP/1.1 200 OK
Connection: close
Content-Length: 407302
Content-Type: text/plain; version=0.0.4
sysctl_kern_osrevision 199506
sysctl_kern_maxvnodes 213575
sysctl_kern_maxproc 13508
sysctl_kern_maxfiles 259846
sysctl_kern_argmax 524288
…
9000 other measurements
How do I write a full blown web-listening prometheus exporter for this ?
It should be possible with little code, but how ?