eonx-com/easy-request-id
Composer 安装命令:
composer require eonx-com/easy-request-id
包简介
Uniquely identify each request across multiple projects
README 文档
README
---eonx_docs--- title: Introduction weight: 0 ---eonx_docs---
Microservices infrastructures are common, one request can involve N different applications sending requests to each other, and it can be hard to link events occurring across them. This package objective is to create a standard way in PHP projects to resolve/share IDs across projects so linking requests becomes easier!
It is based on 2 different IDs:
- request_id: ID of request specific to each project
- correlation_id: shared ID across projects for the same initial request
On the top of resolving those IDs for you, this package also comes with integrations to different packages to automatically include those IDs in your:
- bugsnag notifications: using EasyBugsnag
- error responses: using EasyErrorHandler
- logs: using EasyLogging
- webhooks: using EasyWebhook
Dependencies
This package has dependencies on the following packages, please see their documentation directly:
Require package (Composer)
The recommended way to install this package is to use Composer:
$ composer require eonx-com/easy-request-id
Usage
This package is based on a single service providing the requestId and correlationId anywhere you need them:
// src/Controller/MyController.php namespace App\Controller; use EonX\EasyRequestId\Common\Provider\RequestIdProviderInterface; final class MyController { public function __construct(private RequestIdProviderInterface $requestIdProvider) { } public function __invoke() { $requestId = $this->requestIdProvider->getRequestId(); $correlationId = $this->requestIdProvider->getCorrelationId(); // Use the IDs in your logic... } }
eonx-com/easy-request-id 适用场景与选型建议
eonx-com/easy-request-id 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 112.43k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2020 年 09 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 eonx-com/easy-request-id 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 eonx-com/easy-request-id 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 112.43k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-09-23