gupalo/prometheus-helper

1.3.0 2024-01-31 10:16 UTC

This package is auto-updated.

Last update: 2024-08-30 01:49:42 UTC


README

PHP Prometheus 库包装器 - promphp/prometheus_client_php

安装

composer require gupalo/prometheus-helper

使用

    public static function registration(bool $isSuccess): void
    {
        if ($isSuccess) {
            PrometheusHelper::inc('analytics_registration_success_total', 'registration success');
        } else {
            PrometheusHelper::inc('analytics_registration_error_total', 'registration error');
        }
    }

另请参阅 tests 文件夹。

如果您想设置自定义的缓存目录 - 使用 PrometheusHelper::setDir('/your/cache/dir/for/prom')