Download the PHP package pointcloudtechnology/laravel-prometheus-exporter without Composer
On this page you can find all versions of the php package pointcloudtechnology/laravel-prometheus-exporter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pointcloudtechnology/laravel-prometheus-exporter
More information about pointcloudtechnology/laravel-prometheus-exporter
Files in pointcloudtechnology/laravel-prometheus-exporter
Package laravel-prometheus-exporter
Short Description A prometheus exporter for Laravel. Forked from Superbalist.
License MIT
Informations about the package laravel-prometheus-exporter
laravel-prometheus-exporter
A prometheus exporter for Laravel.
This is a fork of Superbalist/laravel-prometheus-exporter since the original package depends on an abandoned dependency. See https://github.com/Superbalist/laravel-prometheus-exporter/issues/11 .
This package is a wrapper bridging promphp/prometheus_client_php into Laravel.
Installation
Register the service provider in app.php
Register the facade in app.php
Configuration
The package has a default configuration which uses the following environment variables.
To customize the configuration file, publish the package configuration using Artisan.
You can then edit the generated config at app/config/prometheus.php.
Storage Adapters
The storage adapter is used to persist metrics across requests. The memory adapter is enabled by default, meaning
data will only be persisted across the current request. We recommend using the redis or apc adapter in production
environments.
The PROMETHEUS_STORAGE_ADAPTER env var is used to specify the storage adapter.
If redis is used, the REDIS_HOST and REDIS_PORT vars also need to be configured.
Exporting Metrics
The package adds a /metrics end-point, enabled by default, which exposes all metrics gathered by collectors.
This can be turned on/off using the PROMETHEUS_METRICS_ROUTE_ENABLED var, and can also be changed using the
PROMETHEUS_METRICS_ROUTE_PATH var.
If you would like to protect this end-point, you can write any custom middleware and enable it using
PROMETHEUS_METRICS_ROUTE_MIDDLEWARE.
Collectors
A collector is a class, implementing the CollectorInterface, which is responsible for collecting data for one or many metrics.
Please see the ExampleCollector included in this repository.
You can auto-load your collectors by adding them to the collectors array in the prometheus.php config.
Usage
All versions of laravel-prometheus-exporter with dependencies
illuminate/support Version ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0
illuminate/routing Version ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0
promphp/prometheus_client_php Version ^2.6