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)059.3k↓49.7%MITPHP

Since Mar 16Pushed 2y 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 2d 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

32

—

LowBetter than 69% of packages

Maintenance20

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

1936d 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

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25126.1M82](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.9M6.9k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k24.3k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87965.9k114](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.4M92](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69127.2k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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