diff --git a/src/Pools/Pool.php b/src/Pools/Pool.php index b345f4a..9a485dd 100644 --- a/src/Pools/Pool.php +++ b/src/Pools/Pool.php @@ -229,8 +229,8 @@ public function use(callable $callback): mixed $connection = $this->pop(); return $callback($connection->getResource()); } finally { + $this->telemetryUseDuration->record(microtime(true) - $start, $this->telemetryAttributes); if ($connection !== null) { - $this->telemetryUseDuration->record(microtime(true) - $start, $this->telemetryAttributes); $this->reclaim($connection); } }