PHPackages                             marvin9002/prometheus-exporter - 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. marvin9002/prometheus-exporter

ActiveLibrary

marvin9002/prometheus-exporter
==============================

A laravel service provider to export metrics for prometheus.

v1.9.4(6y ago)035MITPHPPHP &gt;=7.2

Since Jul 28Pushed 6y agoCompare

[ Source](https://github.com/marvin9002/prometheus-exporter)[ Packagist](https://packagist.org/packages/marvin9002/prometheus-exporter)[ RSS](/packages/marvin9002-prometheus-exporter/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (6)Versions (26)Used By (0)

LaravelPrometheusExporter
=========================

[](#laravelprometheusexporter)

[![Software license](https://camo.githubusercontent.com/0259aa22543ff630a79827cfedede9886eb93e8fd7ea2a089b6ee1330630877d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f747269616465762f4c61726176656c50726f6d6574686575734578706f727465722e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Travis](https://camo.githubusercontent.com/deefffa22e897ce137a49b82d6e9fcf28c8688e63360953bc958b7478c1ca264/68747470733a2f2f7472617669732d63692e6f72672f747269616465762f4c61726176656c50726f6d6574686575734578706f727465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/triadev/LaravelPrometheusExporter)[![Coveralls](https://camo.githubusercontent.com/849d48ddb839360fd501a4566b9b90ef5fdceb8e0921dce4a4b28947fc06428d/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f747269616465762f4c61726176656c50726f6d6574686575734578706f727465722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/triadev/LaravelPrometheusExporter?branch=master)[![CodeCov](https://camo.githubusercontent.com/95613a520b6ae4877823572a5543acf1fefcc27825a87a00f0d6ba843e3b0d2d/68747470733a2f2f636f6465636f762e696f2f67682f747269616465762f4c61726176656c50726f6d6574686575734578706f727465722f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/triadev/LaravelPrometheusExporter)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/59980a90e6b6eefe0efda554e62fa2fe4401e3d5127e6d431b2abd0474da466c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f747269616465762f4c61726176656c50726f6d6574686575734578706f727465722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/triadev/LaravelPrometheusExporter/?branch=master)[![Latest stable](https://camo.githubusercontent.com/7b051809be1d059681b4e68fd606a69abd892918f88abc1fcd98a6878342a957/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f747269616465762f6c61726176656c2d70726f6d6574686575732d6578706f727465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/triadev/laravel-prometheus-exporter)[![Monthly installs](https://camo.githubusercontent.com/d114db72d49f63382ecfb67ca9d17b7d6475440195b0507df87a8e8f6692b587/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f747269616465762f6c61726176656c2d70726f6d6574686575732d6578706f727465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/triadev/laravel-prometheus-exporter/stats)[![Total Downloads](https://camo.githubusercontent.com/20b99a0be43c5f0d068ba54bd162c2195b549461552e4d67e105886006e3cea6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f747269616465762f6c61726176656c2d70726f6d6574686575732d6578706f727465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/triadev/laravel-prometheus-exporter)[![Average time to resolve an issue](https://camo.githubusercontent.com/4ff51e53250e63716716329bbc2eae6fac70700134ec4dee501fc7c5417ae416/687474703a2f2f697369746d61696e7461696e65642e636f6d2f62616467652f7265736f6c7574696f6e2f747269616465762f4c61726176656c50726f6d6574686575734578706f727465722e737667)](http://isitmaintained.com/project/triadev/LaravelPrometheusExporter "Average time to resolve an issue")[![Percentage of issues still open](https://camo.githubusercontent.com/b59b7a96aab7d403650c933511f11e1ae812b7373967256da9003da82dedf4a2/687474703a2f2f697369746d61696e7461696e65642e636f6d2f62616467652f6f70656e2f747269616465762f4c61726176656c50726f6d6574686575734578706f727465722e737667)](http://isitmaintained.com/project/triadev/LaravelPrometheusExporter "Percentage of issues still open")

A laravel service provider to export metrics for prometheus.

Supported laravel versions
--------------------------

[](#supported-laravel-versions)

[![Laravel 5.6](https://camo.githubusercontent.com/19208e4e17c5a44f6eeb2ca49987cf944b671fbd1069f1e5cc006c509f119e2b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d352e362d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://laravel.com)[![Laravel 5.7](https://camo.githubusercontent.com/01e109b20d194f8c9f7398bde86682d9457d92fbf7485b4ffabf6746df741d64/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d352e372d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://laravel.com)[![Laravel 5.8](https://camo.githubusercontent.com/af472893bacd7e92126a6c6eae58acd9e851cedd0b2cd54a9aad91d8c4f7ec95/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d352e382d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://laravel.com)[![Laravel 6.0](https://camo.githubusercontent.com/5300b40d51583886319c2fa9c1c83d12e190ca51bd8f7e2e5c0f6f2db055ac56/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d362e302d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://laravel.com)[![Laravel 7.0](https://camo.githubusercontent.com/5300b40d51583886319c2fa9c1c83d12e190ca51bd8f7e2e5c0f6f2db055ac56/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d362e302d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://laravel.com)

Main features
-------------

[](#main-features)

- Metrics with APC
- Metrics with Redis
- Metrics with InMemory
- Metrics with the push gateway
- Request per route middleware (total and duration metrics)

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

[](#installation)

### Composer

[](#composer)

> composer require triadev/laravel-prometheus-exporter

### Application

[](#application)

The package is registered through the package discovery of laravel and Composer.

>

Once installed you can now publish your config file and set your correct configuration for using the package.

```
php artisan vendor:publish --provider="Triadev\PrometheusExporter\Provider\PrometheusExporterServiceProvider" --tag="config"
```

This will create a file `config/prometheus-exporter.php`.

Configuration
-------------

[](#configuration)

KeyEnvValueDescriptionDefaultadapterPROMETHEUS\_ADAPTERSTRINGapc, redis, inmemory or pushapcnamespace---STRINGdefault: appappnamespace\_http---STRINGnamespace for "RequestPerRoute-Middleware metrics"httpredis.hostPROMETHEUS\_REDIS\_HOST, REDIS\_HOSTSTRINGredis host127.0.0.1redis.portPROMETHEUS\_REDIS\_PORT, REDIS\_PORTINTEGERredis port6379redis.passwordPROMETHEUS\_REDIS\_PASSWORD, REDIS\_PASSWORDSTRINGredis passwordnullredis.timeout---FLOATredis timeout0.1redis.read\_timeout---INTEGERredis read timeout10push\_gateway.addressPROMETHEUS\_PUSH\_GATEWAY\_ADDRESSSTRINGpush gateway addresslocalhost:9091buckets\_per\_route---STRINGhistogram buckets for "RequestPerRoute-Middleware"---### buckets\_per\_route

[](#buckets_per_route)

```
'buckets_per_route' => [
    ROUTE-NAME => [10,20,50,100,200],
    ...
]

```

Usage
-----

[](#usage)

### Get metrics

[](#get-metrics)

#### Laravel

[](#laravel)

When you are using laravel you can use the default http endpoint:

> triadev/pe/metrics

Of course you can also register your own route. Here is an example:

```
Route::get(
    ROUTE,
    \Triadev\PrometheusExporter\Controller\LaravelController::class . '@metrics'
);

```

### Middleware

[](#middleware)

#### RequestPerRoute

[](#requestperroute)

A middleware to build metrics for "request\_total" and "requests\_latency\_milliseconds" per route.

##### Alias

[](#alias)

> lpe.requestPerRoute

##### Metrics

[](#metrics)

1. requests\_total (inc)
2. requests\_latency\_milliseconds (histogram)

##### Example

[](#example)

```
$router->get('/test/route', function () {
    return 'valid';
})->middleware('lpe.requestPerRoute');
```

> app\_requests\_latency\_milliseconds\_bucket{route="/test/route",method="GET",status\_code="200",le="0.005"} 0 ... app\_requests\_latency\_milliseconds\_count{route="/test/route",method="GET",status\_code="200"} 1 app\_requests\_latency\_milliseconds\_sum{route="/test/route",method="GET",status\_code="200"} 6 app\_requests\_total{route="/test/route",method="GET",status\_code="200"} 1

Roadmap
-------

[](#roadmap)

- histogram buckets per route (RequestPerRoute)

Reporting Issues
----------------

[](#reporting-issues)

If you do find an issue, please feel free to report it with GitHub's bug tracker for this project.

Alternatively, fork the project and make a pull request. :)

Testing
-------

[](#testing)

1. docker-compose up
2. docker exec fpm ./vendor/phpunit/phpunit/phpunit

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Christopher Lorke](https://github.com/triadev)
- [All Contributors](../../contributors)

Other
-----

[](#other)

### Project related links

[](#project-related-links)

- [Wiki](https://github.com/triadev/LaravelPrometheusExporter/wiki)
- [Issue tracker](https://github.com/triadev/LaravelPrometheusExporter/issues)

### Author

[](#author)

- [Christopher Lorke](mailto:christopher.lorke@gmx.de)

### License

[](#license)

The code for LaravelPrometheusExporter is distributed under the terms of the MIT license (see [LICENSE](LICENSE)).

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 72.4% 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 ~42 days

Recently: every ~36 days

Total

25

Last Release

2195d ago

PHP version history (3 changes)v1.0.0PHP &gt;=7.0

v1.3.0PHP &gt;=7.1

v1.8.0PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/fa41a0daa136b249bd215dc25311aef2284adc48648289ff70a014e837502c42?d=identicon)[marvin9002](/maintainers/marvin9002)

---

Top Contributors

[![triadev](https://avatars.githubusercontent.com/u/10552858?v=4)](https://github.com/triadev "triadev (21 commits)")[![marvin-liu-sx](https://avatars.githubusercontent.com/u/11420194?v=4)](https://github.com/marvin-liu-sx "marvin-liu-sx (6 commits)")[![martianoff](https://avatars.githubusercontent.com/u/7222812?v=4)](https://github.com/martianoff "martianoff (1 commits)")[![MyIgel](https://avatars.githubusercontent.com/u/1448057?v=4)](https://github.com/MyIgel "MyIgel (1 commits)")

---

Tags

laravelMetricsprometheus

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/marvin9002-prometheus-exporter/health.svg)

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

###  Alternatives

[triadev/laravel-prometheus-exporter

A laravel and lumen service provider to export metrics for prometheus.

2728.2k1](/packages/triadev-laravel-prometheus-exporter)[renoki-co/octane-exporter

Export Laravel Octane metrics using this Prometheus exporter.

30128.9k](/packages/renoki-co-octane-exporter)

PHPackages © 2026

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