Download the PHP package aleteus/prometheus_client_php without Composer
On this page you can find all versions of the php package aleteus/prometheus_client_php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package prometheus_client_php
Prometheus Client em PHP
Instalação
Como usar?
Explicando:
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' => $var1. A string 'name1' pra indicar o nome que indique o valor da váriável '$var1'.
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:
Pushgateway
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 precisa ter o valor de algum momento do processamento do código.
- O vai enviar o array que criamos no exemlo anterior.
- E o 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!
Tipos de métricas
Histogram
- 'Histograms' captam eventos e a frequência que estes ocorrem.
Counter
- 'Counters' tem a utilidade de seu próprio significado, simplesmente um contador, o qual se reinicia no final do processo.
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:
Prometheus: https://blog.ruanbekker.com/blog/2019/05/07/setup-prometheus-and-node-exporter-on-ubuntu-for-epic-monitoring/
Pushgateway: https://blog.ruanbekker.com/blog/2019/05/17/install-pushgateway-to-expose-metrics-to-prometheus/
All versions of prometheus_client_php with dependencies
PHP Build Version
Package Version
Requires
php Version
^7.1
ext-json Version *
guzzlehttp/guzzle Version ^6.2
symfony/polyfill-apcu Version ^1.6
ext-json Version *
guzzlehttp/guzzle Version ^6.2
symfony/polyfill-apcu Version ^1.6
The package aleteus/prometheus_client_php contains the following files
Loading the files please wait ....