Skip to content

Commit

Permalink
Redis - Metrics collection should not write anything
Browse files Browse the repository at this point in the history
  • Loading branch information
iksss-invia committed Nov 28, 2024
1 parent 50b70a6 commit 9508d1e
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 9508d1e

Please sign in to comment.