PHPackages                             minbaby/hyperf-sentry - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. minbaby/hyperf-sentry

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

minbaby/hyperf-sentry
=====================

v3.0.3(3y ago)1926.7k↓20%9MITPHPPHP &gt;=8.0

Since May 18Pushed 3y ago2 watchersCompare

[ Source](https://github.com/minbaby/hyperf-sentry)[ Packagist](https://packagist.org/packages/minbaby/hyperf-sentry)[ RSS](/packages/minbaby-hyperf-sentry/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (12)Versions (20)Used By (0)

hyperf sentry
=============

[](#hyperf-sentry)

WARNING
-------

[](#warning)

1. 原版sentry更新比较多，如果需要可以自行 fork 然后修改。

    -
    -
    -
2. 新版升级，改动较多

    - 使用 [class\_map](https://hyperf.wiki/2.0/#/zh-cn/annotation?id=classmap-%e5%8a%9f%e8%83%bd) 重写 `\Sentry\SentrySdk`
    - 使用 Aspect，拦截单例，`Minbaby\HyperfSentry\Aspect\SingletonHookAspect::class`

已知问题
----

[](#已知问题)

1. sentry/sdk 依赖的 http 类库报错

    报错 `Argument 1 passed to swoole_curl_setopt() must be an instance of Swoole\Curl\Handler, null given`

    - `vendor/sentry/sentry/src/Transport/HttpTransport.php:110`
    - `vendor/symfony/http-client/Response/CurlResponse.php:74`

    解决方案：

    1. 编译 `swoole` 的时候， 需要启用 ` --enable-swoole-curl` 参数，
    2. 关闭CURL HOOK，修改 `SWOOLE_HOOK_FLAGS` to `SWOOLE_HOOK_ALL ^ SWOOLE_HOOK_CURL`

    说明：

    1. 从 v4.5.4 版本起，`SWOOLE_HOOK_ALL` 包括 `SWOOLE_HOOK_CURL` （这种是不完全hook，在某些场景下会报错）
    2. 从 v4.6.0 版本起，启用`--enable-swoole-curl`后， `SWOOLE_HOOK_ALL` 包括 `SWOOLE_HOOK_NATIVE_CURL`

说明
--

[](#说明)

`sentry/sdk` 类库经过更新迭代，当前版本已经非常现代化了(3.0+)。再辅以 `Hyperf` 2.0+ 强大的 `AOP`功能，除了少部分单例和辅助方法，基本已经不需要特殊修改了。

版本
--

[](#版本)

主版本和 hyperf 保持一致

versionhyperf version说明0.1.\*1.1.\*-2.0.\*2.0.\*-2.2.\*&gt;=2.1.\*本次更新移除 hyperf 包依赖3.0.\*&gt;=3.0.\*因为 `Hyperf\Utils\Context` =&gt; `Hyperf\Utils\Context`使用
--

[](#使用)

1. 安装

```
composer require minbaby/hyperf-sentry
```

2. 配置文件

发布： `php bin/hyperf.php vendor:publish minbaby/hyperf-sentry`

然后在 `.env` 中添加 `SENTRY_DSN=`

3. 注册 `SentryExceptionHandler`

```
return [
    'handler' => [
        'http' => [
            Minbaby\HyperfSentry\SentryExceptionHandler::class,
            App\Exception\Handler\AppExceptionHandler::class,
        ],
    ],
];
```

4. 执行 `php bin/hyperf.php sentry:test`

参考
--

[](#参考)

-
-

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 97.3% 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 ~64 days

Recently: every ~6 days

Total

17

Last Release

1160d ago

Major Versions

v0.2.0 → v2.0.02020-07-04

v2.2.1 → v3.0.02022-12-10

v2.2.2 → v3.0.22023-02-22

v2.2.x-dev → v3.0.32023-03-16

PHP version history (2 changes)v0.1.0PHP &gt;=7.2

v3.0.0.rcPHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/7e1fd5dce869f8b37de31b92e798dcf631e626d5e0bab8a3e5d5b11f9a3113cf?d=identicon)[minbaby](/maintainers/minbaby)

---

Top Contributors

[![minbaby](https://avatars.githubusercontent.com/u/3191858?v=4)](https://github.com/minbaby "minbaby (36 commits)")[![ljyljy0211](https://avatars.githubusercontent.com/u/1272007?v=4)](https://github.com/ljyljy0211 "ljyljy0211 (1 commits)")

---

Tags

phpsentryhyperf

###  Code Quality

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/minbaby-hyperf-sentry/health.svg)

```
[![Health](https://phpackages.com/badges/minbaby-hyperf-sentry/health.svg)](https://phpackages.com/packages/minbaby-hyperf-sentry)
```

###  Alternatives

[justbetter/magento2-sentry

Magento 2 Logger for Sentry

1851.5M3](/packages/justbetter-magento2-sentry)[friendsofhyperf/sentry

The sentry component for Hyperf.

1864.6k](/packages/friendsofhyperf-sentry)

PHPackages © 2026

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