PHPackages                             kafkiansky/push-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. kafkiansky/push-prometheus

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

kafkiansky/push-prometheus
==========================

Pushing metrics to prometheus via amphp.

v0.1.1(4y ago)151MITPHPPHP ^8.1

Since Apr 12Pushed 4y ago1 watchersCompare

[ Source](https://github.com/kafkiansky/push-prometheus)[ Packagist](https://packagist.org/packages/kafkiansky/push-prometheus)[ RSS](/packages/kafkiansky-push-prometheus/feed)WikiDiscussions master Synced 4w ago

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

Push Prometheus.
================

[](#push-prometheus)

[![test](https://github.com/kafkiansky/push-prometheus/workflows/test/badge.svg?event=push)](https://github.com/kafkiansky/push-prometheus/workflows/test/badge.svg?event=push)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Total Downloads](https://camo.githubusercontent.com/062c98b37c3e23532e286c9e1e924eefab1b8080f6f6ede3d28d66f674e08229/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b61666b69616e736b792f707573682d70726f6d6574686575732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kafkiansky/push-prometheus)

### Contents

[](#contents)

- [Installation](#installation)
- [Usage](#usage)
- [Testing](#testing)
- [License](#license)

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

[](#installation)

```
composer require kafkiansky/push-prometheus
```

Usage
-----

[](#usage)

Simple example with default http client:

```
use Amp\Http\Client\Request;
use Kafkiansky\PushPrometheus\Context;
use Kafkiansky\PushPrometheus\Metrics\Counter;
use Kafkiansky\PushPrometheus\Metrics\Name;
use Kafkiansky\PushPrometheus\Metrics\Number;
use Kafkiansky\PushPrometheus\Pusher;

require_once __DIR__.'/vendor/autoload.php';

Amp\Loop::run(function (): \Generator {
    $pusher = new Pusher(new Context(host: 'https://pushgateway.test.net/', groups: [
        'job'      => 'gateway',
        'instance' => 'localhost',
    ]));

    yield $pusher->push(new Counter(new Name('test', 'namespace', 'subsystem'), new Number(2)));
});
```

With custom http client:

```
use Amp\Http\Client\Request;
use Kafkiansky\PushPrometheus\Context;
use Kafkiansky\PushPrometheus\Metrics\Gauge;
use Kafkiansky\PushPrometheus\Metrics\Name;
use Kafkiansky\PushPrometheus\Metrics\Number;
use Kafkiansky\PushPrometheus\Pusher;
use Amp\Http\Client\HttpClient;
use Amp\Http\Client\HttpClientBuilder;

require_once __DIR__.'/vendor/autoload.php';

Amp\Loop::run(function (): \Generator {
    $pusher = new Pusher(new Context(host: 'https://pushgateway.test.net/', groups: [
        'job'      => 'gateway',
        'instance' => 'localhost',
    ]), function (): HttpClient {
        return HttpClientBuilder::buildDefault();
    });

    yield $pusher->push(new Gauge(new Name('test', 'namespace', 'subsystem'), new Number(2)));
});
```

Testing
-------

[](#testing)

```
$ composer test
```

License
-------

[](#license)

The MIT License (MIT). See [License File](LICENSE) for more information.

###  Health Score

22

—

LowBetter than 23% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity48

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

1487d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4b0c87976a285325177559e27d154a9b5019466800c6a3342db916140c512ede?d=identicon)[kafkiansky](/maintainers/kafkiansky)

---

Top Contributors

[![kafkiansky](https://avatars.githubusercontent.com/u/37590388?v=4)](https://github.com/kafkiansky "kafkiansky (3 commits)")

---

Tags

phpamphpprometheuspushgateway

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/kafkiansky-push-prometheus/health.svg)

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

###  Alternatives

[lkaemmerling/laravel-horizon-prometheus-exporter

A small package to gain and export long time information from Laravel &amp; Horizon for Prometheus.

1602.0M](/packages/lkaemmerling-laravel-horizon-prometheus-exporter)[inspector-apm/inspector-symfony

Code Execution Monitoring for Symfony applications.

2830.1k2](/packages/inspector-apm-inspector-symfony)

PHPackages © 2026

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