PHPackages                             aleteus/prometheus\_client\_php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. aleteus/prometheus\_client\_php

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

aleteus/prometheus\_client\_php
===============================

Prometheus instrumentation library for PHP applications.

1.0.1(6y ago)16Apache-2.0PHPPHP ^7.1

Since Jun 24Pushed 6y agoCompare

[ Source](https://github.com/aleteus/prometheus_client_php)[ Packagist](https://packagist.org/packages/aleteus/prometheus_client_php)[ RSS](/packages/aleteus-prometheus-client-php/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (3)Versions (21)Used By (0)

Prometheus Client em PHP
========================

[](#prometheus-client-em-php)

Instalação
----------

[](#instalação)

```
composer require aleteus/prometheus_client_php
```

Como usar?
----------

[](#como-usar)

```

            $parameters = [
                'name1' => $var1,
                'name2' => $var2,
                'name3' => $var3
            ];

            $prometheus = new PrometheusClient(
                '*:9091',
                'nome',
                'da_metrica',
                'produto',
                $parameters,
                'tipo da metrica (histogram, counter ou gauge)', 'nome_da_aplicação');

                $prometheus->pushGateway($timeProcess, $parameters, $help);
```

Explicando:
===========

[](#explicando)

Parameters:
-----------

[](#parameters)

- O parameters armazena informações adicionais que são escolhidas de acordo com a necessidade da monitoria, e aparecem em forma de 'etiquetas' na interface do Pushgateway, as quais serão manipuladas na hora de montar os gráficos no Grafana. Este mantém o padrão 'name1' =&gt; $var1. A string 'name1' pra indicar o nome que indique o valor da váriável '$var1'.

Prometheus:
-----------

[](#prometheus)

- O cliente é criado a partir de sete argumentos:
    - Endereço do Pushgateway,
    - Nome da métrica (separado por duas strings)
    - Nome do produto
    - O próprio $parameters
    - Tipo da métrica
    - Nome da aplicação

### Exemplo:

[](#exemplo)

```
$prometheus = new PrometheusClient(
                '*:9091',
                'nome',
                'da_metrica',
                'produto',
                $parameters,
                'tipo da metrica (histogram, counter ou gauge)', 'nome_da_aplicação');

                $prometheus->pushGateway($timeProcess, $parameters, $help);
```

Pushgateway
-----------

[](#pushgateway)

```
$prometheus->pushGateway($timeProcess, $parameters, $help);
```

Essa parte do código é a responsável por enviar todas as informações para o Prometheus e Pushgateway e ela possui três parâmetros obrigatórios: ($timeProcess, $parameters, $help).

- O `$timeprocess` precisa ter o valor de algum momento do processamento do código.
- O `$parameters` vai enviar o array que criamos no exemlo anterior.
- E o `$help` vai possuir alguma informação adicional que queira armazenar no Pushgateway.

#### - Obs: Se algum desses parâmetros for nulo, o envio não irá funcionar!

[](#--obs-se-algum-desses-parâmetros-for-nulo-o-envio-não-irá-funcionar)

Tipos de métricas
-----------------

[](#tipos-de-métricas)

### Histogram

[](#histogram)

- 'Histograms' captam eventos e a frequência que estes ocorrem.

### Counter

[](#counter)

- 'Counters' tem a utilidade de seu próprio significado, simplesmente um contador, o qual se reinicia no final do processo.

### Gauge

[](#gauge)

-'Gauges' são similarres aos 'Counters', mas o valor de um Gauge pode subir ou descer.

Guias de instalação do Prometheus e Pushgateway:
------------------------------------------------

[](#guias-de-instalação-do-prometheus-e-pushgateway)

#### Prometheus:

[](#prometheus-httpsblogruanbekkercomblog20190507setup-prometheus-and-node-exporter-on-ubuntu-for-epic-monitoring)

#### Pushgateway:

[](#pushgateway-httpsblogruanbekkercomblog20190517install-pushgateway-to-expose-metrics-to-prometheus)

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~66 days

Recently: every ~254 days

Total

19

Last Release

2414d ago

Major Versions

v0.9.1 → v1.0.02019-07-22

PHP version history (4 changes)v0.1.0PHP &gt;=5.6.0

v0.2.0PHP &gt;=5.3.3

v0.6.0PHP &gt;=5.6.3

v1.0.0PHP ^7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/910898a8e6692bc30ffb7b481c99a5536c3f6c22b25e54c5d4e299f55185678b?d=identicon)[alemetheus](/maintainers/alemetheus)

---

Top Contributors

[![schnipseljagd](https://avatars.githubusercontent.com/u/289073?v=4)](https://github.com/schnipseljagd "schnipseljagd (110 commits)")[![bracki](https://avatars.githubusercontent.com/u/49786?v=4)](https://github.com/bracki "bracki (98 commits)")[![NoelDavies](https://avatars.githubusercontent.com/u/572911?v=4)](https://github.com/NoelDavies "NoelDavies (14 commits)")[![aleteus](https://avatars.githubusercontent.com/u/60751383?v=4)](https://github.com/aleteus "aleteus (9 commits)")[![martinssipenko](https://avatars.githubusercontent.com/u/598744?v=4)](https://github.com/martinssipenko "martinssipenko (6 commits)")[![mps-sepetrov](https://avatars.githubusercontent.com/u/24416480?v=4)](https://github.com/mps-sepetrov "mps-sepetrov (3 commits)")[![buffcode](https://avatars.githubusercontent.com/u/2863518?v=4)](https://github.com/buffcode "buffcode (3 commits)")[![DeyV](https://avatars.githubusercontent.com/u/311626?v=4)](https://github.com/DeyV "DeyV (2 commits)")[![carusogabriel](https://avatars.githubusercontent.com/u/16328050?v=4)](https://github.com/carusogabriel "carusogabriel (2 commits)")[![rdohms](https://avatars.githubusercontent.com/u/94331?v=4)](https://github.com/rdohms "rdohms (2 commits)")[![simPod](https://avatars.githubusercontent.com/u/327717?v=4)](https://github.com/simPod "simPod (1 commits)")[![bvisness](https://avatars.githubusercontent.com/u/4707402?v=4)](https://github.com/bvisness "bvisness (1 commits)")[![crazycodr](https://avatars.githubusercontent.com/u/4398521?v=4)](https://github.com/crazycodr "crazycodr (1 commits)")[![fbhdk](https://avatars.githubusercontent.com/u/10439895?v=4)](https://github.com/fbhdk "fbhdk (1 commits)")[![glensc](https://avatars.githubusercontent.com/u/199095?v=4)](https://github.com/glensc "glensc (1 commits)")[![Gounlaf](https://avatars.githubusercontent.com/u/236413?v=4)](https://github.com/Gounlaf "Gounlaf (1 commits)")[![kswzr](https://avatars.githubusercontent.com/u/31246037?v=4)](https://github.com/kswzr "kswzr (1 commits)")[![oraoto](https://avatars.githubusercontent.com/u/24709398?v=4)](https://github.com/oraoto "oraoto (1 commits)")[![seiffert](https://avatars.githubusercontent.com/u/1111118?v=4)](https://github.com/seiffert "seiffert (1 commits)")[![1player](https://avatars.githubusercontent.com/u/690120?v=4)](https://github.com/1player "1player (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/aleteus-prometheus-client-php/health.svg)

```
[![Health](https://phpackages.com/badges/aleteus-prometheus-client-php/health.svg)](https://phpackages.com/packages/aleteus-prometheus-client-php)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[larabug/larabug

Laravel 6.x/7.x/8.x/9.x/10.x/11.x/12.x/13.x bug notifier

299549.3k1](/packages/larabug-larabug)[honeybadger-io/honeybadger-php

Honeybadger PHP library

381.5M4](/packages/honeybadger-io-honeybadger-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
