This repo contains a demo app for Laravel Prometheus.
You'll find more info on how to use this app in this blog post.
The demo application is vanilla Laravel app with:
- Laravel Prometheus installed
- Laravel Horizon installed with 4 queues configured
- An artisan command
app:dispatch-jobs
to dispatch dummy jobs
Clone this repo and run composer install
.
You should install the Grafana agent via brew and not start it as a daemon (we'll start it manually later on).
The agent config should be saved at /opt/homebrew/etc/grafana-agent/config.yml
metrics:
wal_directory: /Users/<your-user-name>/dev/code/grafana-wal
global:
scrape_interval: 10s
configs:
- name: hosted-prometheus
scrape_configs:
- job_name: laravel
scrape_interval: 10s
metrics_path: /prometheus
static_configs:
- targets: ['prometheus-demo-app.test']
remote_write:
- url: <your-grafana-com-prometheus-url>
basic_auth:
username: <your-grafana-prometheus-username>
password: <your-grafana-prometheus-password>
- Start horizon using
php artisan horizon
. - Start the grafana agent using
composer start-agent
. - Dispatch jobs using
php artisan app:dispatch-jobs
.
Metrics will be sent to Grafana.com
Agent log is at /opt/homebrew/var/log/grafana-agent.log
Agent error log is at /opt/homebrew/var/log/grafana-agent.err.log