bedrockstreaming/newrelic-guzzle-http-host
Composer 安装命令:
composer require bedrockstreaming/newrelic-guzzle-http-host
包简介
A workaround to report Guzzle requests with correct Host Http header in NewRelic.
README 文档
README
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 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
composer require bedrockstreaming/newrelic-guzzle-http-host
That's all! The script is automatically imported thanks to Composer autoloader.
ℹ️ You can also copy the content of newrelic_hook.php directly in your project.
Explanations
The newrelic extension defines a Php function, a 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.
bedrockstreaming/newrelic-guzzle-http-host 适用场景与选型建议
bedrockstreaming/newrelic-guzzle-http-host 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 59.26k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 03 月 16 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 bedrockstreaming/newrelic-guzzle-http-host 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 bedrockstreaming/newrelic-guzzle-http-host 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 59.26k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 17
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-03-16