gupalo/prometheus-helper

Prometheus Helper

1.10.0 2024-11-05 12:29 UTC

This package is auto-updated.

Last update: 2024-11-05 12:30:08 UTC


README

Wrapper for PHP Prometheus library - https://github.com/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').