PHP code example of altelma / laravel-prometheus-exporter

1. Go to this page and download the library: Download altelma/laravel-prometheus-exporter library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

altelma / laravel-prometheus-exporter example snippets


$app->register(Altelma\LaravelPrometheusExporter\PrometheusServiceProvider::class);

protected $middleware = [
    \Altelma\LaravelPrometheusExporter\Middleware\PrometheusLaravelMiddleware::class,
];

$app->middleware([
    \Altelma\LaravelPrometheusExporter\Middleware\PrometheusLumenMiddleware::class,
]);

$app->routeMiddleware([
    'http.prometheus' => \Altelma\LaravelPrometheusExporter\Middleware\PrometheusLumenRouteMiddleware::class,
]);