---
title: PHP agent support for Guzzle
source: https://docs.newrelic.com/docs/apm/agents/php-agent/frameworks-libraries/guzzle
---

New Relic supports versions 5, 6, 7, and 8 of the **Guzzle HTTP client library**.

The Guzzle library allows both sequential and parallel requests. This page describes how each type of request will appear in the [**Summary** page](https://docs.newrelic.com/docs/apm/applications-menu/monitoring/apm-overview-page) in the New Relic UI. To discover which call was the slowest, view the [External Services page](https://docs.newrelic.com/docs/apm/applications-menu/monitoring/external-services-page) which displays timing for individual external calls.

## Sequential requests [#more_help]

This PHP code makes multiple sequential requests with Guzzle:

```php
$client = new \GuzzleHttp\Client;
$response = $client->get('http://YOUR_SITE.com/api/foo');
$client->delete('http://YOUR_SITE.com/api/foo/'.$response->getBody());
```

This code would appear in the New Relic UI as:

![guzzle_sequential.png](https://docs.newrelic.com/images/apm_screenshot-crop_guzzle-sequence.webp "Sequential requests with Guzzle")

**[one.newrelic.com > All capabilities](https://one.newrelic.com/all-capabilities) > APM & services > (select an app) > Overview > Web transactions time**: Sequential requests with Guzzle in the New Relic UI.

[Response time](https://docs.newrelic.com/docs/data-analysis/user-interface-functions/response-time) is shown as the dark blue line. The green **web external time** represents time spent in the Guzzle library. Because the requests were made sequentially, the response time is **equal** to the [total time](https://docs.newrelic.com/docs/data-analysis/user-interface-functions/response-time#response-time-total-time) spent in PHP, MySQL, and web external activities.

## Parallel requests [#more_help]

This PHP code makes multiple requests in parallel by unwrapping an array of promises:

```php
$client = new \GuzzleHttp\Client;

$promises = [
    $client->getAsync('http://YOUR_SITE.com/api/foo'),
    $client->getAsync('http://YOUR_SITE.com/api/bar'),
    $client->getAsync('http://YOUR_SITE.com/api/quux'),
];

\GuzzleHttp\Promise\unwrap($promises);
```

This code would appear in the New Relic UI as:

![Parallel requests with Guzzle](https://docs.newrelic.com/images/apm_screenshot-crop_guzzle-parallel.webp "Parallel requests with Guzzle")

**[one.newrelic.com > All capabilities](https://one.newrelic.com/all-capabilities) > APM & services > (select an app) > Summary > Web transactions time**: Parallel requests with Guzzle in the New Relic UI

The green **web external time** represents time spent in the Guzzle library. Because the requests were performed asynchronously, the [total time](https://docs.newrelic.com/docs/data-analysis/user-interface-functions/response-time#response-time-total-time) spent in PHP, MySQL, and web external is **greater** than the response time.

## Timing with Guzzle 6 and 7 [#timing]

Unlike previous versions, Guzzle 6 and 7 do not generate an event when a request is sent. Instead, the agent begins timing a request when the request object is created. If a request object is created and additional work is done before sending, New Relic may report that the request took longer than it actually did.

## Disable Guzzle support

To disable Guzzle support:

1.  Add `newrelic.guzzle.enabled = false` to your `newrelic.ini` file.
2.  [Restart your web server](https://docs.newrelic.com/docs/agents/php-agent/troubleshooting/why-when-restart-your-web-server-php) (Apache, Nginx, PHP-FPM, etc.).
