PHPackages                             tweedegolf/prometheus-client - 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. tweedegolf/prometheus-client

AbandonedArchivedLibrary

tweedegolf/prometheus-client
============================

A PHP Prometheus client library

v0.4.0(4y ago)11493.7k—9%16[3 issues](https://github.com/tweedegolf/prometheus-client/issues)3MITPHPPHP &gt;=7.0

Since Jul 6Pushed 2y ago5 watchersCompare

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

READMEChangelog (1)Dependencies (2)Versions (8)Used By (3)

Not maintained
==============

[](#not-maintained)

Since Tweede Golf does not use / maintain this library anymore (for several years already) - this repository is archived. If you like like to maintain this - please contact us at

Tweede Golf Prometheus PHP Client
=================================

[](#tweede-golf-prometheus-php-client)

A PHP Client for prometheus, providing several storage backends. This client mostly follows the guidelines as specified in the [prometheus docs](https://prometheus.io/docs/instrumenting/clientlibs/).

This library currently does not implement the Summary metric type. For users of Symfony a [prometheus client bundle](https://github.com/tweedegolf/prometheus-bundle) is available.

Installation
------------

[](#installation)

This library uses [Composer](https://getcomposer.org). Simply run the following command to add it as a dependency to your project:

```
composer require tweedegolf/prometheus-client

```

Usage
-----

[](#usage)

To start, you must create a `CollectorRegistry`. To this registry you may register any number of metric collectors. To create a collector registry you must specificy a storage adapter. For easy setup you may want to try the APC or APCU Storage adapters. See the example below:

```
use TweedeGolf\PrometheusClient\CollectorRegistry;
use TweedeGolf\PrometheusClient\Storage\ApcuAdapter;

$registry = new CollectorRegistry(new ApcuAdapter());
$registry->createCounter('requests', [], null, true);
$registry->createGauge('traffic', ['endpoint'], 'Active traffic per endpoint', true);
```

Next on some event (like a request entering your application) you can modify the existing metrics. An example is shown below:

```
$registry->getCounter('requests')->inc();
$registry->getGauge('traffic')->set(10, ['/home']);
```

Finally your application should expose some endpoint where metrics can be scraped by Prometheus:

```
use TweedeGolf\PrometheusClient\Format\TextFormatter;

$formatter = new TextFormatter();
header('Content-Type', $formatter->getMimeType());
echo $formatter->format($registry->collect());
```

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity46

Moderate usage in the ecosystem

Community27

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~275 days

Recently: every ~391 days

Total

7

Last Release

1589d ago

PHP version history (2 changes)v0.1.0PHP &gt;=5.6.0

v0.4.0PHP &gt;=7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/8df75c1b70003dca1beac9b4cd2f57b8f144cc20a4af6d0d227c64d1c48f1baf?d=identicon)[tweedegolf](/maintainers/tweedegolf)

![](https://www.gravatar.com/avatar/86a9633404b0317dcde9ecb9c54f88c4d54bc42bb137d462933773bbe3a539b9?d=identicon)[rnijveld](/maintainers/rnijveld)

---

Top Contributors

[![marlonbaeten](https://avatars.githubusercontent.com/u/885089?v=4)](https://github.com/marlonbaeten "marlonbaeten (8 commits)")[![rnijveld](https://avatars.githubusercontent.com/u/193783?v=4)](https://github.com/rnijveld "rnijveld (8 commits)")[![tobiashaase](https://avatars.githubusercontent.com/u/11973795?v=4)](https://github.com/tobiashaase "tobiashaase (4 commits)")[![Wassasin](https://avatars.githubusercontent.com/u/733400?v=4)](https://github.com/Wassasin "Wassasin (2 commits)")[![gdsmith](https://avatars.githubusercontent.com/u/908695?v=4)](https://github.com/gdsmith "gdsmith (2 commits)")[![nanawel](https://avatars.githubusercontent.com/u/4866761?v=4)](https://github.com/nanawel "nanawel (1 commits)")[![fliam](https://avatars.githubusercontent.com/u/68889094?v=4)](https://github.com/fliam "fliam (1 commits)")[![davfer-cmp](https://avatars.githubusercontent.com/u/44781153?v=4)](https://github.com/davfer-cmp "davfer-cmp (1 commits)")[![bfoosness](https://avatars.githubusercontent.com/u/224901?v=4)](https://github.com/bfoosness "bfoosness (1 commits)")

---

Tags

phpprometheusprometheus-clientprometheus-client-library

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tweedegolf-prometheus-client/health.svg)

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

PHPackages © 2026

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