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: Self-hosted weight: 3

To receive metrics from your applications using Prometheus, and visualize them using Grafana, you can use a docker image that is deployed on your server.

Here are the general steps to set up Prometheus and Grafana via Laravel Forge. This isn't meant as a full guide, but rather as a starting point for you to get started.

1. Provision a server on Laravel Forge and install Prometheus and Grafana on it

2. Configure Prometheus to scrape the metrics from your application and store them in its database

  • Edit the Prometheus configuration file /etc/prometheus/prometheus.yml and add a new job to scrape metrics from your application. For example:
scrape_configs:
- job_name: laravel
  scrape_interval: 10s
  metrics_path: /prometheus
  static_configs:
    - targets: ['your-laravel-app.com']

This configuration tells Prometheus to scrape metrics from your application every 10 seconds and store them in its database.

3. Configure Grafana to connect to Prometheus and visualize the metrics:

  • Open Grafana in your web browser by visiting http://your-server-ip:3000.
  • Log in with the default credentials (username: admin, password: admin).
  • Add a new Prometheus data source by clicking on the gear icon on the left sidebar, then selecting "Data Sources", then "Add data source".
  • Fill in the form with the following details:

Name: Prometheus Type: Prometheus URL: http://localhost:9090

This configuration tells Grafana to connect to Prometheus at http://localhost:9090.

  • Create a new dashboard by clicking on the plus icon on the left sidebar, then selecting "Dashboard", then "Add new panel".
  • Choose a visualization type (e.g. graph, gauge, table) and configure it to display the metrics you want to monitor.
  • Save the dashboard and view it to see the metrics in real-time.

That's it! You should now have Prometheus and Grafana set up to monitor your application's metrics.

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