PHPackages                             slepic/guzzle-http-observing-middleware - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. slepic/guzzle-http-observing-middleware

ActiveLibrary[HTTP &amp; Networking](/categories/http)

slepic/guzzle-http-observing-middleware
=======================================

Adapter of slepic/http-transfer ObserverInterface to guzzlehttp/guzzle middleware.

1.0.2(2y ago)020.1k1BSD-3-ClausePHPPHP &gt;=5.6CI failing

Since May 4Pushed 2y ago1 watchersCompare

[ Source](https://github.com/slepic/guzzle-http-observing-middleware)[ Packagist](https://packagist.org/packages/slepic/guzzle-http-observing-middleware)[ RSS](/packages/slepic-guzzle-http-observing-middleware/feed)WikiDiscussions master Synced yesterday

READMEChangelog (5)Dependencies (4)Versions (6)Used By (1)

[![Build Status](https://camo.githubusercontent.com/62158546eea8541126bde5efdff8d9cefda93bf6c426b6f795ddaa55b34e694f/68747470733a2f2f7472617669732d63692e6f72672f736c657069632f67757a7a6c652d687474702d6f6273657276696e672d6d6964646c65776172652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/slepic/guzzle-http-observing-middleware)[![Style Status](https://camo.githubusercontent.com/fc96836732b651bdef888282bdd452b222a0493293b4598dda0909660f838db2/68747470733a2f2f7374796c6563692e696f2f7265706f732f3138343432333334302f736869656c64)](https://styleci.io/repos/184423340)

guzzle-http-observing-middleware
================================

[](#guzzle-http-observing-middleware)

Adapter of [ObserverInterface](https://github.com/slepic/http-transfer/blob/master/src/Observer/ObserverInterface.php) from [slepic/http-transfer](https://packagist.org/packages/slepic/http-transfer) package to [guzzlehttp/guzzle](https://packagist.org/packages/guzzlehttp/guzzle) middleware.

[packagist](https://packagist.org/packages/slepic/guzzle-http-observing-middleware)

Requirements
------------

[](#requirements)

PHP &gt;=5.6

Installation
------------

[](#installation)

Install with composer.

`composer require slepic/guzzle-http-observing-middleware`

Usage
-----

[](#usage)

Wrap any instance of [`\Slepic\Http\Transfer\Observer\ObserverInterface`](https://github.com/slepic/http-transfer/blob/master/src/Observer/ObserverInterface.php) from package [`slepic/http-transfer`](https://packagist.org/packages/slepic/http-transfer) in the [`\Slepic\Guzzle\Http\ObservingMiddleware\ObservingMiddleware`](https://github.com/slepic/guzzle-http-observing-middleware/blob/master/src/ObservingMiddleware.php) and pass it to handler stack of your guzzle client.

All requests sent through the guzzle client will now be notified when requests are starting to get processed and when responses are received.

See an example where we use [`\Slepic\Http\Transfer\History\HistoryObserver`](https://github.com/slepic/http-transfer/blob/master/src/History/HistoryObserver.php) to log requests and responses with timing.

```
$storage = new ArrayStorage();
$observer = new HistoryObserver($storage);
$middleware = new ObservingMiddleware($observer);

$client = new \GuzzleHttp\Client();
$client->getConfig('handler')->unshift($middleware);

try {
$response = $client->request($method, $uri);
} catch (\Exception $e) {
  assert($storage[0]->getRequest()->getMethod() === $method);
  assert((string)($storage[0]->getRequest()->getUri()) === $uri);
  assert($storage[0]->getException() === $e);
  assert(0 < ($storage[0]->getEndTime() - $storage[0]->getStartTime()));
  throw $e;
}

assert($storage[0]->getRequest()->getMethod() === 'GET');
assert((string)($storage[0]->getRequest()->getUri()) === $uri);
assert($storage[0]->getResponse() === $response);
assert(0 < ($storage[0]->getEndTime() - $storage[0]->getStartTime()));

```

Related
-------

[](#related)

- See [slepic/http-transfer-observer-implementation](https://packagist.org/providers/slepic/http-transfer-observer-implementation) for known observers.
- See [slepic/psr-http-message-tracy-panel](https://packagist.org/packages/slepic/psr-http-message-tracy-panel) to get your http client transfer into [Tracy](https://tracy.nette.org/en/).

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~406 days

Total

5

Last Release

990d ago

Major Versions

0.1.1 → 1.0.02021-03-10

PHP version history (2 changes)0.1.0PHP ^5.6 || ^7.0

1.0.0PHP &gt;=5.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/5dd1cd12d4fe4974ad1e3609065ac4eb13c29023606c289c08153c432da827cf?d=identicon)[slepic](/maintainers/slepic)

---

Top Contributors

[![slepic](https://avatars.githubusercontent.com/u/8199404?v=4)](https://github.com/slepic "slepic (10 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/slepic-guzzle-http-observing-middleware/health.svg)

```
[![Health](https://phpackages.com/badges/slepic-guzzle-http-observing-middleware/health.svg)](https://phpackages.com/packages/slepic-guzzle-http-observing-middleware)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[illuminate/http

The Illuminate Http package.

11937.9M6.9k](/packages/illuminate-http)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M47](/packages/tencentcloud-tencentcloud-sdk-php)[guzzlehttp/guzzle-services

Provides an implementation of the Guzzle Command library that uses Guzzle service descriptions to describe web services, serialize requests, and parse responses into easy to use model structures.

25711.0M191](/packages/guzzlehttp-guzzle-services)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
