PHPackages                             jlis/php-prometheus - 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. jlis/php-prometheus

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

jlis/php-prometheus
===================

A PHP client for Prometheus.

v1.0.1(7y ago)12791MITPHPPHP &gt;=5.6.3

Since Sep 11Pushed 7y agoCompare

[ Source](https://github.com/jlis/php-prometheus)[ Packagist](https://packagist.org/packages/jlis/php-prometheus)[ RSS](/packages/jlis-php-prometheus/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

php-prometheus
==============

[](#php-prometheus)

A PHP client for Prometheus

[![Build Status](https://camo.githubusercontent.com/d993407e57375e8aba51ca14b2eda13079ea844f57d3149e3d829a19bb607416/68747470733a2f2f7472617669732d63692e6f72672f6a6c69732f7068702d70726f6d6574686575732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/jlis/php-prometheus)[![StyleCI](https://camo.githubusercontent.com/2ae3a4e374f53af498d426fadec7ddae74e71c01ca310e8d3162c7eb47f0a679/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3134383133313233392f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/148131239)

Install
-------

[](#install)

Require this package with composer using the following command:

```
composer require jlis/php-prometheus
```

Usage
-----

[](#usage)

First create an adapter:

```
$adapter = new \Jlis\PhpPrometheus\Adapter\RedisAdapter(['host' => 'localhost']);
```

Next, you may pass it to the collector and start collecting metrics:

```
$collector = new \Jlis\PhpPrometheus\Collector\MetricsCollector($adapter);
```

#### Counts

[](#counts)

```
$collector->incrementCount('http_requests_total', 1, ['url' => 'http://foo.bar']);
```

#### Gauge

[](#gauge)

```
$collector->updateGauge('current_queue_size', 1337, ['queue' => 'notifications']);
```

#### Histogram

[](#histogram)

```
$collector->updateHistogram('some_histogram', 3.5, ['color' => 'blue'], [0.1, 1, 2, 3.5, 4, 5, 6, 7, 8, 9]);
```

#### Expose the metrics

[](#expose-the-metrics)

```
header('Content-Type: ' . \Jlis\PhpPrometheus\Collector\MetricsCollector::MIME_TYPE);

echo $collector->render();
```

> **Note:** Be sure to set the correct content type for Prometheus.

Adapters
--------

[](#adapters)

The following adapters are available:

- `\Jlis\PhpPrometheus\Adapter\InMemoryAdapter` uses a plain PHP array, only suitable for testing.
- `\Jlis\PhpPrometheus\Adapter\RedisAdapter` uses Redis and requires the `ext-redis` PHP extension.
- `\Jlis\PhpPrometheus\Adapter\ApcuAdapter` uses APCu and requires the `ext-apcu` PHP extension.

You can easily create your own storage adapter by extending the `\Jlis\PhpPrometheus\Adapter\AbstractAdapter` class.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

2803d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/25b826c5ac145a7fb5a19710a1b04b940ca8cc801f3503d35af4afbaf6fe3283?d=identicon)[jlis](/maintainers/jlis)

---

Top Contributors

[![jlis](https://avatars.githubusercontent.com/u/1401164?v=4)](https://github.com/jlis "jlis (27 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/jlis-php-prometheus/health.svg)

```
[![Health](https://phpackages.com/badges/jlis-php-prometheus/health.svg)](https://phpackages.com/packages/jlis-php-prometheus)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
