2017 © Pedro Peláez
 

library prometheus-client

A PHP Client for Prometheus

image

krenor/prometheus-client

A PHP Client for Prometheus

  • Monday, June 4, 2018
  • by Krenor
  • Repository
  • 2 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

A Prometheus client library for PHP

Monitor your PHP applications using Prometheus., (*1)

![Packagist][icon-version] ![icon-php] Travis ![Quality][icon-code-quality] Coverage ![License][icon-license], (*2)

Features

  • Support for Counters, Gauges, Histograms, Summaries and custom metrics
  • Various storage repositories
  • Easy usage in style of Laravels Eloquent ORM
  • Initialization of Metrics without labels
  • Support of float values
  • Push Gateway
  • State exporters (for fpm_get_status() or opcache_get_status())

Planned features

  • PHP 7.4 rewrite
  • Laravel integration

Project State

This library is currently under development.

As long as it's not tagged in a >= 1.* version I could commit incompatible changes!, (*3)

Quickstart

<?php

use Krenor\Prometheus\Metrics\Metric;
use Krenor\Prometheus\Metrics\Counter;
use Krenor\Prometheus\CollectorRegistry;
use Krenor\Prometheus\Renderer\TextRenderer;
use Krenor\Prometheus\Storage\StorageManager;
use Krenor\Prometheus\Storage\Repositories\InMemoryRepository;
use Krenor\Prometheus\Tests\Stubs\MultipleLabelsCounterStub as ExampleCounter;

Metric::storeUsing(new StorageManager(new InMemoryRepository));

$registry = new CollectorRegistry;

/** @var Counter $counter */
$counter = $registry->register(new ExampleCounter);

$counter->increment(['some', 'label', 'values']);
$counter->incrementBy(3, ['foo', 'bar', 'baz']);

$samples = $registry->collect();
$metrics = (new TextRenderer)->render($samples);

A more detailed documentation can be found here., (*4)

Note: Since this project is in the works, some parts may lack documentation.
You can orient yourself on the tests if something's unclear.
, (*5)

Contributing

Please see CONTRIBUTING for more information., (*6)

Licence

The MIT License. Please see LICENSE for more information., (*7)

The Versions

04/06 2018

dev-develop

dev-develop

A PHP Client for Prometheus

  Sources   Download

MIT

The Requires

 

The Development Requires

metrics monitoring prometheus

16/05 2018

dev-master

9999999-dev

A PHP Client for Prometheus

  Sources   Download

MIT

The Requires

 

The Development Requires

metrics monitoring prometheus

16/05 2018

0.2.0

0.2.0.0

A PHP Client for Prometheus

  Sources   Download

MIT

The Requires

 

The Development Requires

metrics monitoring prometheus

03/05 2018

0.1.0

0.1.0.0

A PHP Client for Prometheus

  Sources   Download

MIT

The Requires

 

The Development Requires

metrics monitoring prometheus