Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Prometheus Laravel Package

spatie/laravel-prometheus

Export Laravel app metrics to Prometheus via a /prometheus endpoint. Register custom gauges/counters with simple callbacks, use built-in queue and Horizon metrics, and optionally secure the endpoint. Ideal for scraping by Prometheus and charting in Grafana.

View on GitHub
Deep Wiki
Context7

title: v1 slogan: Export Laravel metrics to Prometheus githubUrl: https://github.com/spatie/laravel-prometheus branch: main

This packages make it easy to export the key metrics of your Laravel application with Prometheus. Typically, you would use this package in combination with Prometheus / Grafana to monitor the health of your application.

Exporting data to Prometheus is very straightforward.

// typically in a service provider
use \Spatie\Prometheus\Facades\Prometheus;

Prometheus::addGauge('Number of users')
    ->value(fn() =>  User::count());

This will expose a metric named Number of users with the current number of users as value. By default, the metric will be exposed on the /prometheus endpoint.


Additionally, this package can export Horizon metrics, so you can easily build a graph that shows the number of jobs in the queue.

// TODO insert screenshot
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport