PHPackages                             bexiocom/prometheus\_php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. bexiocom/prometheus\_php

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

bexiocom/prometheus\_php
========================

A PHP instrumentation library for Prometheus compatible with PHP 5.5 5.6, 7.0 and 7.1.

946.0k2[1 issues](https://github.com/bexiocom/prometheus_php/issues)PHP

Since Aug 31Pushed 8y ago1 watchersCompare

[ Source](https://github.com/bexiocom/prometheus_php)[ Packagist](https://packagist.org/packages/bexiocom/prometheus_php)[ RSS](/packages/bexiocom-prometheus-php/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (1)Used By (0)

A Prometheus client library for PHP
===================================

[](#a-prometheus-client-library-for-php)

[![Build Status](https://camo.githubusercontent.com/9a61202b7306192213889cddddd8440f8730c1b0a4b374848f455c289bd2badf/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f626578696f636f6d2f70726f6d6574686575735f7068702e737667)](https://travis-ci.org/bexiocom/prometheus_php)[![Code Climate](https://camo.githubusercontent.com/4b27fbcbd8a6cb9bb5fd23bb7acfff517c4542641fb3a5df0166248c20c477ec/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6769746875622f626578696f636f6d2f70726f6d6574686575735f7068702e737667)](https://codeclimate.com/github/bexiocom/prometheus_php)[![Test Coverage](https://camo.githubusercontent.com/148a874908570fb4b678fc9d1bc9fa936fd320016b1ec689ca0c257c62ab28ce/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f636f7665726167652f6769746875622f626578696f636f6d2f70726f6d6574686575735f7068702e737667)](https://codeclimate.com/github/bexiocom/prometheus_php/coverage)[![Latest Stable Version](https://camo.githubusercontent.com/b5bc6d62f9aac054fb0c651e3398ea03359c208c13754e5c58d193564f274925/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f626578696f636f6d2f70726f6d6574686575735f7068702e737667)](https://packagist.org/packages/bexiocom/prometheus_php)

This library aims to be a lightweight utility for instrumenting a PHP application using [Prometheus](https://prometheus.io). It is heavily inspired by the [golang client](https://github.com/prometheus/client_golang).

- The library is supposed to be compatible with the PHP version 5.5, 5.6, 7.0 and 7.1.
- This library tries to do not take any assumptions about the environment it is used in. You should be able to use it without any magic or with what ever tool belt you are using. Be it a lightweight dependency injection, Sympfony or something else.

Features
--------

[](#features)

- Counter, Gauge and Histogram metric types.
- Redis and in memory storage.
- Rendering to text format.

Missing features
----------------

[](#missing-features)

- Summary metric types.
- Ability to submit metric samples to a PushGateway.
- Storage utilising filesystem, Memcached and APC.
- Rendering to Protocol buffer format
- Registry class to ease usage when using the library without andy dependency injection tool.

Getting Started
---------------

[](#getting-started)

Add this library to your project.

```
composer require bexiocom/prometheus_php:dev-master
```

Usage
-----

[](#usage)

Simple counter with no labels attached:

```
