PHPackages                             uuu9/u9-php-prometheus - 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. uuu9/u9-php-prometheus

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

uuu9/u9-php-prometheus
======================

v1.0.1(3y ago)07PHPPHP &gt;=7.0.12

Since Sep 28Pushed 3y ago1 watchersCompare

[ Source](https://github.com/haowenzou/uuu9-u9-php-prometheus)[ Packagist](https://packagist.org/packages/uuu9/u9-php-prometheus)[ RSS](/packages/uuu9-u9-php-prometheus/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (3)Versions (3)Used By (0)

uuu9-php-prometheus
===================

[](#uuu9-php-prometheus)

metrics规范 TODO
--------------

[](#metrics规范-todo)

[http://git.vpgame.cn/infra/desgin-docs/blob/master/confirmed/monitor/prometheus\_metrics.md](http://git.vpgame.cn/infra/desgin-docs/blob/master/confirmed/monitor/prometheus_metrics.md)

依赖
--

[](#依赖)

- [ext-apcu](https://pecl.php.net/package/APCU): 使用共享内存来维护PHP-FPM多进程状态
- [jimdo/prometheus\_client\_php](https://packagist.org/packages/jimdo/prometheus_client_php): PrometheusSDK

代码参考
----

[](#代码参考)

支持框架
----

[](#支持框架)

- lumen5.3
- lumen5.4
- *laravel(待支持)*

目录
--

[](#目录)

```
├── src
│   ├── Config
│   │   └── config.php 基本配置
│   ├── Contract
│   │   └── PrometheusExporterContract.php Interface
│   ├── Controller
│   │   └── PrometheusExporterController.php 控制器，暴露数据接口
│   ├── Middleware
│   │   └── RequestPerRoute.php 路由中间件(主业务)
│   ├── PrometheusExporter.php 整合PrometheusSDK调用，implements PrometheusExporterContract
│   ├── Provider
│   │   └── PrometheusExporterServiceProvider.php 服务提供者，框架启动时加载注册
│   └── Storage
│       └── APCU.php 数据存储适配器

```

lumen项目配置
---------

[](#lumen项目配置)

1 `composer.json` repositories节点新增

```
{
    "type": "vcs",
    "url": "git@github.com:haowenzou/uuu9-u9-php-prometheus.git"
}
```

2 运行命令

```
composer require uuu9/u9-php-prometheus
```

3 `.env.tp`文件，新增 `APP_ROUTE_PREFIX=路由前缀`，如`APP_ROUTE_PREFIX=sso`

4 `bootstrap/app.php`

```
//注册prometheus
$app->register(Uuu9\U9PhpPrometheus\Provider\PrometheusExporterServiceProvider::class);
```

laravel
-------

[](#laravel)

laravel需要特殊处理

TODO:

- 新增Controller namespace Illuminate\\Routing\\Controller

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

2

Last Release

1373d ago

### Community

Maintainers

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

---

Top Contributors

[![haowenzou](https://avatars.githubusercontent.com/u/30683389?v=4)](https://github.com/haowenzou "haowenzou (6 commits)")

### Embed Badge

![Health badge](/badges/uuu9-u9-php-prometheus/health.svg)

```
[![Health](https://phpackages.com/badges/uuu9-u9-php-prometheus/health.svg)](https://phpackages.com/packages/uuu9-u9-php-prometheus)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B11.4k](/packages/psr-log)[open-telemetry/api

API for OpenTelemetry PHP.

1941.5M273](/packages/open-telemetry-api)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2328.5M336](/packages/open-telemetry-sdk)

PHPackages © 2026

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