aptarus / prom-client-php
Prometheus client library for PHP.
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 4
Forks: 0
Open Issues: 0
pkg:composer/aptarus/prom-client-php
Requires
- php: ~5.6|~7.0
- ext-pdo: *
- ext-pdo_sqlite: *
Requires (Dev)
- phpunit/phpunit: ~4.0||~5.0
- squizlabs/php_codesniffer: ^2.3
This package is not auto-updated.
Last update: 2025-10-26 01:22:29 UTC
README
This library allows users to record and export stats about a program in a way that Prometheus can make use of. Statistics are stored locally in the filesystem using sqlite; no additional service is required to record the statistics.
Note that this is likely only really useful for a PHP site with low usage. Once you get more than a 2 or 3 QPS you're likely looking at needing a different library for this.
Install
Via Composer
$ composer require aptarus/promClientPhp
Usage
Add this to composer.json:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/aptarus/promClientPhp.git"
}
],
"require": {
"php" : "~5.5|~7.0",
"aptarus/promClientPhp": "dev-master"
}
}
Client:
# TODO
Endpoint:
# TODO
Prometheus config:
# TODO
Change log
Please see CHANGELOG for more information what has changed recently.
Testing
composer test
Test prerequisites
Need to install the following on Ubuntu for testing to work:
sudo apt-get install php-codesniffer phpunit php5-sqlite
Contributing
Please see CONTRIBUTING and CONDUCT for details.
Contribution notes
This package is based on the PHP league's skeleton. From time to time it's not a bad idea to try merging in the skeleton project in case there are new bits of the php ecosystem this project might benefit from. To do this just run:
git fetch git@github.com:thephpleague/skeleton.git
Security
If you discover any security related issues, please email kevin.lyda@aptarus.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.