Thanks for writing this exporter.
Here are a few, hopefully, improvements:
Run on port 9810. Picked one from Default port allocations. 9090 is not the best choice, since Prometheus itself also uses that port. Good idea would be to claim and "register" 9810 (or any other free port) and use that going forward.
Changed metric type from counter (supposed to only increase) to gauge where applicable.
Transform memory metrics to be in bytes, update description to make it clear.
Added poolsUsed and poolsTotal metrics.
Updated regexp matcher to match N/A as well. This is because, apparently, when running ClamAV in docker, it shows N/A for heap, mmap and used memory, and only shows numbers for pool metrics.
Fixed so the exporter does not die when it fails to parse a string (e.g. the N/A from above), and instead just report it as NaN, and move on.
Fixed the exporter not showing any clamav_* metrics when it cannot reach ClamAV for some reason. It now shows clamav_up 0, if that is the case. This should simplify alert rule logic, if one would want to get an alert when ClamAV is down.
Some other minor stuff suggested by syntax checker.
Thanks for writing this exporter. Here are a few, hopefully, improvements:
9090
is not the best choice, since Prometheus itself also uses that port. Good idea would be to claim and "register"9810
(or any other free port) and use that going forward.counter
(supposed to only increase) togauge
where applicable.poolsUsed
andpoolsTotal
metrics.N/A
as well. This is because, apparently, when running ClamAV in docker, it showsN/A
forheap
,mmap
andused
memory, and only shows numbers for pool metrics.N/A
from above), and instead just report it asNaN
, and move on.clamav_*
metrics when it cannot reach ClamAV for some reason. It now showsclamav_up 0
, if that is the case. This should simplify alert rule logic, if one would want to get an alert when ClamAV is down.