Wrapper for PHP Prometheus library - https://github.com/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');
}
}
Also see tests
.
If you want to set custom directory for cache - PrometheusHelper::setDir('/your/cache/dir/for/prom')
.