csa/guzzle-stopwatch-middleware
Adds a Guzzle middleware that measures request/response timing with a stopwatch, making it easy to profile HTTP calls in your app. Install via Composer and plug into your Guzzle handler stack to track durations per request.
HttpClient facade) or custom Guzzle instances.Http client (via GuzzleHttp\Client under the hood), reducing friction for teams already using the framework’s HTTP utilities.Log facade or a dedicated monitoring library (e.g., spatie/laravel-monitoring) for richer observability.api/v1/users) or global?Horizon (queues) or Nova (admin panel) for performance dashboards?HttpClient facade or custom Guzzle instances?monolog/monolog with custom processors)?Http client (Illuminate\Support\Facades\Http), which uses Guzzle under the hood. Add middleware via:
Http::macro('withStopwatch', function () {
return $this->withMiddleware(new \Csa\GuzzleStopwatchMiddleware\StopwatchMiddleware());
});
laravel-telescope for HTTP metrics).stripe.com").Http::withStopwatch()).StopwatchMiddleware logs to storage/logs/laravel.log by default).StopwatchMiddleware::withName('stripe_api')).Http::withOptions([
'middleware' => [
new \Csa\GuzzleStopwatchMiddleware\StopwatchMiddleware('stripe', 'api'),
],
]);
StopwatchMiddleware first for request timing, last for response timing.Http facade.Illuminate\Contracts\Http\Client implementations.$request/$response in a way that breaks timing.composer require csa/guzzle-stopwatch-middleware.guzzlehttp/guzzle:^7.0).single for metrics).GuzzleHttp\HandlerStack::getHandlers() to inspect middleware.trace() or OpenTelemetry.How can I help you explore Laravel packages today?