PHPackages                             fxmonster/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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. fxmonster/laravel-prometheus

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

fxmonster/laravel-prometheus
============================

Export Laravel metrics to Prometheus

00PHP

Since Nov 22Pushed 2y agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

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. 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)

```
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

13

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity20

Early-stage or recently created project

 Bus Factor1

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

### Community

Maintainers

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

---

Top Contributors

[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (103 commits)")[![riasvdv](https://avatars.githubusercontent.com/u/3626559?v=4)](https://github.com/riasvdv "riasvdv (4 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![fideloper](https://avatars.githubusercontent.com/u/467411?v=4)](https://github.com/fideloper "fideloper (2 commits)")[![fxmonster](https://avatars.githubusercontent.com/u/13942239?v=4)](https://github.com/fxmonster "fxmonster (2 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")[![josecl](https://avatars.githubusercontent.com/u/16781078?v=4)](https://github.com/josecl "josecl (1 commits)")[![maxacarvalho](https://avatars.githubusercontent.com/u/45166618?v=4)](https://github.com/maxacarvalho "maxacarvalho (1 commits)")[![mbardelmeijer](https://avatars.githubusercontent.com/u/1583095?v=4)](https://github.com/mbardelmeijer "mbardelmeijer (1 commits)")[![pataar](https://avatars.githubusercontent.com/u/3403851?v=4)](https://github.com/pataar "pataar (1 commits)")[![fabianpnke](https://avatars.githubusercontent.com/u/36986615?v=4)](https://github.com/fabianpnke "fabianpnke (1 commits)")

### Embed Badge

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

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

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

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