PHPackages                             bedrockstreaming/newrelic-guzzle-http-host - 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. bedrockstreaming/newrelic-guzzle-http-host

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

bedrockstreaming/newrelic-guzzle-http-host
==========================================

A workaround to report Guzzle requests with correct Host Http header in NewRelic.

v1.0.0(5y ago)056.9k↓39.1%MITPHP

Since Mar 16Pushed 1y ago14 watchersCompare

[ Source](https://github.com/BedrockStreaming/newrelic-guzzle-http-host)[ Packagist](https://packagist.org/packages/bedrockstreaming/newrelic-guzzle-http-host)[ RSS](/packages/bedrockstreaming-newrelic-guzzle-http-host/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (3)Used By (0)

newrelic-guzzle-http-host
=========================

[](#newrelic-guzzle-http-host)

A workaround to report Guzzle requests with correct Host Http header in NewRelic.

In some case, you may use a common proxy for several external calls to various hosts, using the standard [`Host`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Host) to route your requests. Unfortunatly, since all of these calls use the same uri, NewRelic will report them as external calls to the same target.

This small script provide a workaround to report the correct endpoint according to the HTTP `Host` header.

⚠️ This library is a *workaround* relying on the current implementation of the newrelic extension! Test it carefully before to use it with a new extension release. See explanations section below for more details.

ℹ️An official feature request has been submitted to NewRelic team.

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

[](#installation)

```
composer require bedrockstreaming/newrelic-guzzle-http-host

```

That's all! The script is automatically imported thanks to [Composer autoloader](https://getcomposer.org/doc/04-schema.md#files).

ℹ️ You can also copy the content of [`newrelic_hook.php`](newrelic_hook.php) directly in your project.

Explanations
------------

[](#explanations)

The [newrelic extension](https://github.com/newrelic/newrelic-php-agent) [defines a Php function](https://github.com/newrelic/newrelic-php-agent/blob/3f93ee47f80703d46d8fccd53be7d6b80361a594/agent/lib_guzzle6.c#L433-L461), a [Guzzle](https://github.com/guzzle/guzzle) middleware to report some metrics on each requests sent from Php.

Fortunately, the extension defines this function only if it doesn't already exist… then this workaround define this function before newrelic does 😅. Original code is copied in this function, but we create a new http requests dedicated to NewRelic reporting, resolving the Http `HOST` header. The original request used by Guzzle stays unchanged.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

Unknown

Total

1

Last Release

1889d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2069361?v=4)[Patrick](/maintainers/Bedrock)[@Bedrock](https://github.com/Bedrock)

---

Top Contributors

[![Benoit382](https://avatars.githubusercontent.com/u/5646257?v=4)](https://github.com/Benoit382 "Benoit382 (1 commits)")[![b-viguier](https://avatars.githubusercontent.com/u/5537799?v=4)](https://github.com/b-viguier "b-viguier (1 commits)")[![lnahiro](https://avatars.githubusercontent.com/u/14995154?v=4)](https://github.com/lnahiro "lnahiro (1 commits)")

### Embed Badge

![Health badge](/badges/bedrockstreaming-newrelic-guzzle-http-host/health.svg)

```
[![Health](https://phpackages.com/badges/bedrockstreaming-newrelic-guzzle-http-host/health.svg)](https://phpackages.com/packages/bedrockstreaming-newrelic-guzzle-http-host)
```

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78026.4M414](/packages/react-http)[php-http/curl-client

PSR-18 and HTTPlug Async client with cURL

48347.0M384](/packages/php-http-curl-client)[smi2/phpclickhouse

PHP ClickHouse Client

84310.1M71](/packages/smi2-phpclickhouse)

PHPackages © 2026

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