gupalo/prometheus-helper

Prometheus Helper

1.3.0 2024-01-31 10:16 UTC

This package is auto-updated.

Last update: 2024-03-30 00:37:41 UTC


README

Wrapper for PHP Prometheus library - promphp/prometheus_client_php

Install

composer require gupalo/prometheus-helper

Use

    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');
        }
    }

Also see tests.

If you want to set custom directory for cache - PrometheusHelper::setDir('/your/cache/dir/for/prom').