initial commit
This commit is contained in:
commit
bf1a4e1879
17 changed files with 822 additions and 0 deletions
65
README.md
Normal file
65
README.md
Normal file
|
@ -0,0 +1,65 @@
|
|||
# laravel-prometheus-exporter
|
||||
|
||||
A prometheus exporter for Laravel.
|
||||
|
||||
[](https://twitter.com/superbalist)
|
||||
[](https://travis-ci.org/Superbalist/laravel-prometheus-exporter)
|
||||
[](LICENSE)
|
||||
[](https://packagist.org/packages/superbalist/laravel-prometheus-exporter)
|
||||
[](https://packagist.org/packages/superbalist/laravel-prometheus-exporter)
|
||||
|
||||
This package is a wrapper bridging [jimdo/prometheus_client_php](https://github.com/Jimdo/prometheus_client_php) into Laravel.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
composer require superbalist/laravel-prometheus-exporter
|
||||
```
|
||||
|
||||
Register the service provider in app.php
|
||||
```php
|
||||
'providers' => [
|
||||
// ...
|
||||
Superbalist\LaravelPrometheusExporter\PrometheusServiceProvider::class,
|
||||
]
|
||||
```
|
||||
|
||||
Register the facade in app.php
|
||||
```php
|
||||
'aliases' => [
|
||||
// ...
|
||||
'PubSub' => 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.
|
||||
```bash
|
||||
php artisan vendor:publish --provider="Superbalist\LaravelPrometheusExporter\PrometheusServiceProvider"
|
||||
```
|
||||
|
||||
You can then edit the generated config at `app/config/prometheus.php`.
|
||||
|
||||
// TODO:
|
||||
|
||||
## Usage
|
||||
|
||||
```php
|
||||
// TODO:
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue