2 KiB
2 KiB
laravel-prometheus-exporter
A prometheus exporter for Laravel.
This package is a wrapper bridging jimdo/prometheus_client_php into Laravel.
Installation
composer require superbalist/laravel-prometheus-exporter
Register the service provider in app.php
'providers' => [
// ...
Superbalist\LaravelPrometheusExporter\PrometheusServiceProvider::class,
]
Register the facade in app.php
'aliases' => [
// ...
'Prometheus' => Superbalist\LaravelPrometheusExporter\PrometheusFacade::class,
]
Configuration
The package has a default configuration which uses the following environment variables.
PROMETHEUS_NAMESPACE=app
PROMETHEUS_METRICS_ROUTE_ENABLED=true
PROMETHEUS_METRICS_ROUTE_PATH=metrics
PROMETHEUS_METRICS_ROUTE_MIDDLEWARE=null
PROMETHEUS_STORAGE_ADAPTER=memory
REDIS_HOST=localhost
REDIS_PORT=6379
PROMETHEUS_REDIS_PREFIX=PROMETHEUS_
To customize the configuration file, publish the package configuration using Artisan.
php artisan vendor:publish --provider="Superbalist\LaravelPrometheusExporter\PrometheusServiceProvider"
You can then edit the generated config at app/config/prometheus.php
.
// TODO:
Usage
// TODO: