vierbergenlars / bareos_exporter

MIT License
12 stars 7 forks source link

Set poolInfo expired to `false` for newly created volumes #12

Closed vierbergenlars closed 3 years ago

vierbergenlars commented 3 years ago

In case that the volume is freshly created and is being written to currently, lastwritten is NULL, which propagates through the expiry calculation formula, resulting in a boolean field being NULL. This causes an error to be raised, which results in a log line:

Jun 30 23:29:24 backup1 bareos_exporter[21509]: time="2021-06-30T23:29:24Z" level=error msg="sql: Scan error on column index 4, name \"expired\": sql/driver: couldn't convert () into type bool" method=PoolInfo

When an error occurs while fetching pool info, statistics about pools are not exported to prometheus at all, which may result in missing data.

Fixes #9