PHPackages                             spatie/laravel-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. [DevOps &amp; Deployment](/categories/devops)
4. /
5. spatie/laravel-prometheus

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

spatie/laravel-prometheus
=========================

Export Laravel metrics to Prometheus

1.5.0(2mo ago)2651.3M—8.2%40[2 PRs](https://github.com/spatie/laravel-prometheus/pulls)4MITPHPPHP ^8.4CI passing

Since Jun 1Pushed 1mo ago4 watchersCompare

[ Source](https://github.com/spatie/laravel-prometheus)[ Packagist](https://packagist.org/packages/spatie/laravel-prometheus)[ Docs](https://github.com/spatie/laravel-prometheus)[ RSS](/packages/spatie-laravel-prometheus/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (31)Versions (23)Used By (4)

 [   ![Logo for laravel-prometheus](https://camo.githubusercontent.com/d446ec5e8897f3aebdbd6c738641e710eeecbbdca924927c00f2b2258ea58dc3/68747470733a2f2f7370617469652e62652f7061636b616765732f6865616465722f6c61726176656c2d70726f6d6574686575732f68746d6c2f6c696768742e776562703f31)  ](https://spatie.be/open-source?utm_source=github&utm_medium=banner&utm_campaign=laravel-prometheus)Export Laravel metrics to Prometheus
====================================

[](#export-laravel-metrics-to-prometheus)

[![Latest Version on Packagist](https://camo.githubusercontent.com/1e106b8e997b3bd9ee1da429c8d21f71afc1405e1e21906692b40d20dc5adea6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7370617469652f6c61726176656c2d70726f6d6574686575732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/laravel-prometheus)[![GitHub Tests Action Status](https://camo.githubusercontent.com/814d51c37f6a363f12a7c47248af4230821335d41fdf39c25c5e85eba62ac43a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7370617469652f6c61726176656c2d70726f6d6574686575732f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/spatie/laravel-prometheus/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/09d2d2d6806a56592251246522c06af3b87ccafb595eb6cf8c7d5c2c59ebbfbe/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7370617469652f6c61726176656c2d70726f6d6574686575732f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/spatie/laravel-prometheus/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/bcf282a94f577fb63741900a49df2b4ebd110be23785ca160ffde82a6db2ddcb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370617469652f6c61726176656c2d70726f6d6574686575732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/laravel-prometheus)

This package can export key metrics of your app to [Prometheus](https://prometheus.io). It does this by providing an easy way to register metrics and comes out of the box with metrics for Laravel queues and Horizon.

Here's an example where we are going to export the user count to Prometheus.

```
Prometheus::addGauge('User count')
    ->value(fn() => User::count());
```

These metrics will be exposed at the `/prometheus` endpoint. The package offers a way to add a security layer, so your key metrics don't become public.

You can configure your Prometheus instance to periodically crawl and import the metrics at the `/prometheus` endpoint of your app. Using [Grafana](https://grafana.com), you can visualize the data points that are stored in Prometheus.

Support us
----------

[](#support-us)

[![](https://camo.githubusercontent.com/3cd515e310f438214f68b476cf433a902e7af6ff5467c97278c487b703d1cbbb/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f6c61726176656c2d70726f6d6574686575732e6a70673f743d31)](https://spatie.be/github-ad-click/laravel-prometheus)

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).

Documentation
-------------

[](#documentation)

You can find full documentation on [our dedicated documentation site](https://docs.spatie.be/laravel-prometheus).

Testing
-------

[](#testing)

To run the horizon collector tests you need to install the redis extension.

On Ubuntu you can do so with the following command:

```
sudo apt-get install php-redis
```

On MacOS you can do so with the following command:

```
pecl install redis
```

To run the tests call `composer test`:

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

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

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Freek Van der Herten](https://github.com/freekmurze)
- [All Contributors](../../contributors)

The Horizon collectors were heavily inspired on Lukas Kämmerling' excellent [laravel-horizon-prometheus-exporter](https://github.com/LKaemmerling/laravel-horizon-prometheus-exporter) package.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

66

—

FairBetter than 99% of packages

Maintenance88

Actively maintained with recent releases

Popularity60

Solid adoption and visibility

Community33

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 61.8% 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 ~53 days

Recently: every ~96 days

Total

20

Last Release

74d ago

Major Versions

0.0.7 → 1.0.02023-06-03

PHP version history (3 changes)0.0.1PHP ^8.1

1.2.1PHP ^8.3

1.5.0PHP ^8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7535935?v=4)[Spatie](/maintainers/spatie)[@spatie](https://github.com/spatie)

---

Top Contributors

[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (136 commits)")[![AlexVanderbist](https://avatars.githubusercontent.com/u/6287961?v=4)](https://github.com/AlexVanderbist "AlexVanderbist (23 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (15 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (9 commits)")[![pselge-5anker](https://avatars.githubusercontent.com/u/124429124?v=4)](https://github.com/pselge-5anker "pselge-5anker (7 commits)")[![ekateiva](https://avatars.githubusercontent.com/u/12799259?v=4)](https://github.com/ekateiva "ekateiva (4 commits)")[![riasvdv](https://avatars.githubusercontent.com/u/3626559?v=4)](https://github.com/riasvdv "riasvdv (4 commits)")[![jimirobaer](https://avatars.githubusercontent.com/u/8984769?v=4)](https://github.com/jimirobaer "jimirobaer (3 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (3 commits)")[![thdebay](https://avatars.githubusercontent.com/u/1422621?v=4)](https://github.com/thdebay "thdebay (2 commits)")[![fideloper](https://avatars.githubusercontent.com/u/467411?v=4)](https://github.com/fideloper "fideloper (2 commits)")[![eura-app](https://avatars.githubusercontent.com/u/23000916?v=4)](https://github.com/eura-app "eura-app (1 commits)")[![josecl](https://avatars.githubusercontent.com/u/16781078?v=4)](https://github.com/josecl "josecl (1 commits)")[![Ma-ve](https://avatars.githubusercontent.com/u/11227996?v=4)](https://github.com/Ma-ve "Ma-ve (1 commits)")[![maxacarvalho](https://avatars.githubusercontent.com/u/45166618?v=4)](https://github.com/maxacarvalho "maxacarvalho (1 commits)")[![fabianpnke](https://avatars.githubusercontent.com/u/36986615?v=4)](https://github.com/fabianpnke "fabianpnke (1 commits)")[![oralunal](https://avatars.githubusercontent.com/u/1948737?v=4)](https://github.com/oralunal "oralunal (1 commits)")[![pataar](https://avatars.githubusercontent.com/u/3403851?v=4)](https://github.com/pataar "pataar (1 commits)")[![codeh4nter](https://avatars.githubusercontent.com/u/2191137?v=4)](https://github.com/codeh4nter "codeh4nter (1 commits)")[![ralphjsmit](https://avatars.githubusercontent.com/u/59207045?v=4)](https://github.com/ralphjsmit "ralphjsmit (1 commits)")

---

Tags

devopslaravelmeasureprometheusspatielaravellaravel-prometheus

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/spatie-laravel-prometheus/health.svg)

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

###  Alternatives

[spatie/laravel-activitylog

A very simple activity logger to monitor the users of your website or application

5.8k45.4M309](/packages/spatie-laravel-activitylog)[spatie/laravel-health

Monitor the health of a Laravel application

86910.0M83](/packages/spatie-laravel-health)[spatie/laravel-data

Create unified resources and data transfer objects

1.8k28.9M627](/packages/spatie-laravel-data)[spatie/laravel-horizon-watcher

Automatically restart Horizon when local PHP files change

2631.9M](/packages/spatie-laravel-horizon-watcher)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[timokoerber/laravel-one-time-operations

Run operations once after deployment - just like you do it with migrations!

6481.7M11](/packages/timokoerber-laravel-one-time-operations)

PHPackages © 2026

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