PHP code example of uuu9 / u9-php-prometheus

1. Go to this page and download the library: Download uuu9/u9-php-prometheus library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

uuu9 / u9-php-prometheus example snippets


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

├── 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 数据存储适配器
bash
composer