{"repo":"PromPHP/prometheus_client_php","free":true,"listed":false,"github":"https://github.com/PromPHP/prometheus_client_php","clone":"git clone https://github.com/PromPHP/prometheus_client_php.git","description":"Prometheus instrumentation library for PHP applications","language":"PHP","stars":552,"topics":["prometheus","php","prometheus-client-library","metrics","hacktoberfest","apcu","redis"],"license":"Apache-2.0","category":"analytics","readme_excerpt":"A prometheus client library written in PHP This library uses Redis or APCu to do the client side aggregation. If using Redis, we recommend running a local Redis instance next to your PHP workers. How does it work? Usually PHP worker processes don't share any state. You can pick from five adapters. Redis, Predis, APC, APCng, or an in-memory adapter. While the first needs a separate binary running, the second and third just need the APC extension to be installed. If you don't need persistent metrics between requests (e.g. a long running cron job or script) the in-memory adapter might be suitable to use. Installation Add as Composer dependency: Usage A simple counter: Write some enhanced metrics: Manually register and retrieve metrics (these steps are combined in the getOrRegister... methods): Expose the metrics: Change the Redis options (the example shows the defaults): Using the Predis storage (requires predis/predis ): Or with an existing connection: Note: Using Redis::setPrefix() and Predis::setPrefix() share the same prefix. Using both adapters with different prefixes in the same application is not supported. Using the InMemory storage: Using the APC or APCng storage: (see the README.APCng.md file for more details) Using the PDO storage: Advanced Usage Advanced Histogram Usage On passing an empty array for the bucket parameter on instantiation, a set of default buckets will be used instead. Whilst this is a good base for a typical web application, there is named constructor","default_branch":null,"files":null,"tree":[],"storefront":"/r/PromPHP","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/PromPHP/prometheus_client_php/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}