restic-exporter
restic-exporter copied to clipboard
fix: wrong lock count, header output changed in restic versions
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.