ngosang / restic-exporter

Prometheus exporter for the Restic backup system
MIT License
79 stars 17 forks source link

fix: wrong lock count, header output changed in restic versions #27

Closed TheReal1604 closed 1 month ago

TheReal1604 commented 6 months ago

Hey,

I noticed that the metric for the locks was not behaving correctly anymore.

This is due to restic not outputting the header:

repository xyz opened successfully, password is correct

anymore if the output is redirected. You can test that locally with restic list locks --no-locks > test.log.

My solution is to just split the lines by linebreaks and see if the resulting string looks like an ID by a regex -> increasing the counter by one.

ngosang commented 1 month ago

Thank you @TheReal1604 @benendboss

ngosang commented 1 month ago

https://github.com/ngosang/restic-exporter/releases/tag/1.6.0