Skip to content

gupalo/prometheus-helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prometheus Helper

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').

Packages

No packages published

Languages