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.6.0(2mo ago)2831.6M—0.8%434MITPHPPHP ^8.4CI passing

Since Jun 1Pushed 1w 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 3d ago

READMEChangelog (10)Dependencies (46)Versions (24)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://github.com/spatie/laravel-prometheus/actions/workflows/run-tests.yml/badge.svg)](https://github.com/spatie/laravel-prometheus/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://github.com/spatie/laravel-prometheus/actions/workflows/fix-php-code-style-issues.yml/badge.svg)](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

68

—

FairBetter than 99% of packages

Maintenance93

Actively maintained with recent releases

Popularity61

Solid adoption and visibility

Community35

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 60.6% 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

Total

21

Last Release

68d 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 (140 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] (18 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (10 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)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (3 commits)")[![jimirobaer](https://avatars.githubusercontent.com/u/8984769?v=4)](https://github.com/jimirobaer "jimirobaer (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)")[![vcprx](https://avatars.githubusercontent.com/u/67461428?v=4)](https://github.com/vcprx "vcprx (1 commits)")[![josecl](https://avatars.githubusercontent.com/u/16781078?v=4)](https://github.com/josecl "josecl (1 commits)")[![eura-app](https://avatars.githubusercontent.com/u/23000916?v=4)](https://github.com/eura-app "eura-app (1 commits)")[![m0nclous](https://avatars.githubusercontent.com/u/18490365?v=4)](https://github.com/m0nclous "m0nclous (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)")

---

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

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k102.4M1.4k](/packages/spatie-laravel-permission)[spatie/laravel-health

Monitor the health of a Laravel application

87512.0M165](/packages/spatie-laravel-health)[propaganistas/laravel-disposable-email

Disposable email validator

6023.0M7](/packages/propaganistas-laravel-disposable-email)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)

PHPackages © 2026

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