PHPackages                             alan/msf-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. alan/msf-prometheus

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

alan/msf-prometheus
===================

msf support prometheus

v1.0.5(3y ago)014MITPHPPHP ^7.1.3

Since Dec 30Pushed 3y ago1 watchersCompare

[ Source](https://github.com/wzzjjboy/alan-msf-prometheus)[ Packagist](https://packagist.org/packages/alan/msf-prometheus)[ RSS](/packages/alan-msf-prometheus/feed)WikiDiscussions main Synced today

READMEChangelog (4)Dependencies (3)Versions (6)Used By (0)

msf框架接入prometheus
=================

[](#msf框架接入prometheus)

接入步骤：

1. 定义prometheus使用的redis配置

```
$config['redis']['prometheus']['ip']               = '127.0.0.1';
$config['redis']['prometheus']['port']             = 6379;
$config['redis']['prometheus']['select']           = 0;
$config['redis']['prometheus']['password']         = '123456';
```

2. 引入prometheus组件，在入口文件(server.php)添加如下代码

    ```
    \alan\msf_prometheus\di\ClassLoader::init();
    ```
3. 添加支持/metrics路由，创建控制器 app/Controllers/Metrics.php

    ```
