aptarus/prom-client-php

Prometheus client library for PHP.

dev-master / 1.0.x-dev 2016-09-21 15:23 UTC

This package is not auto-updated.

Last update: 2024-04-27 17:09:26 UTC


README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

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.