Skip to content

Commit

Permalink
Redis - Metrics collection should not write anything (#165)
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Pastuszek <[email protected]>
Co-authored-by: Jakub Pastuszek <[email protected]>
  • Loading branch information
iKsSs and iksss-invia authored Dec 2, 2024
1 parent 6d7328e commit d6233cc
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Prometheus/Storage/Redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,11 @@ private function collectSummaries(): array
}

if (count($samples) === 0) {
$this->redis->del($valueKey);
try {
$this->redis->del($valueKey);
} catch (\RedisException $e) {
// ignore if we can't delete the key
}
continue;
}

Expand Down Expand Up @@ -571,7 +575,11 @@ private function collectSummaries(): array
if (count($data['samples']) > 0) {
$summaries[] = $data;
} else {
$this->redis->del($metaKey);
try {
$this->redis->del($metaKey);
} catch (\RedisException $e) {
// ignore if we can't delete the key
}
}
}
return $summaries;
Expand Down

0 comments on commit d6233cc

Please sign in to comment.