diff --git a/src/Symfony/Component/HttpClient/DataCollector/HttpClientDataCollector.php b/src/Symfony/Component/HttpClient/DataCollector/HttpClientDataCollector.php index 9247b7479a4e1..d8305ee638460 100644 --- a/src/Symfony/Component/HttpClient/DataCollector/HttpClientDataCollector.php +++ b/src/Symfony/Component/HttpClient/DataCollector/HttpClientDataCollector.php @@ -39,7 +39,7 @@ public function registerClient(string $name, TraceableHttpClient $client) */ public function collect(Request $request, Response $response/*, \Throwable $exception = null*/) { - $this->reset(); + $this->resetData(); foreach ($this->clients as $name => $client) { [$errorCount, $traces] = $this->collectOnClient($client); @@ -85,6 +85,14 @@ public function getName(): string } public function reset() + { + $this->resetData(); + foreach ($this->clients as $client) { + $client->reset(); + } + } + + private function resetData() { $this->data = [ 'clients' => [],