gupalo / prometheus-helper
Prometheus Helper
Installs: 7 863
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: >=8.3
- ext-json: *
- gupalo/json: *
- promphp/prometheus_client_php: ^2.11
- symfony/http-foundation: ^6.4|^7.1
Requires (Dev)
- phpunit/phpunit: ^10.5
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')
.