gupalo/prometheus-helper

Prometheus Helper

Installs: 12 439

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 1

Open Issues: 0

pkg:composer/gupalo/prometheus-helper

1.10.0 2024-11-05 12:29 UTC

This package is auto-updated.

Last update: 2025-10-05 14:30:14 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').