Skip to content

Commit 6c43694

Browse files
authored
Update Prometheus.php
1 parent 5f0db23 commit 6c43694

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Log/Prometheus.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,12 @@ public function onPhpbuEnd(End $event)
122122
$this->write('# HELP phpbu_backup_size The size of the last successful backup' . PHP_EOL);
123123
$this->write('# TYPE phpbu_backup_size gauge' . PHP_EOL);
124124
foreach ($this->backupStats as $backupName => $backupStats) {
125+
if($this->backupStats[$backupName]['size'] = " ") {
126+
$this->backupStats[$backupName]['size'] = 0;
127+
}
125128
$this->write(
126129
'phpbu_backup_size{name="' . $backupName . '"} ' .
127-
0 .
130+
$this->backupStats[$backupName]['size'] .
128131
PHP_EOL
129132
);
130133
}

0 commit comments

Comments
 (0)