Route name to configs (#4)
This commit is contained in:
parent
c0c0258cde
commit
26842ebdb7
2 changed files with 20 additions and 1 deletions
|
@ -39,6 +39,19 @@ return [
|
|||
|
||||
'metrics_route_path' => env('PROMETHEUS_METRICS_ROUTE_PATH', 'metrics'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Metrics Route Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Route Parh name aliase.
|
||||
|
|
||||
| This is only applicable if metrics_route_enabled is set to true.
|
||||
|
|
||||
*/
|
||||
|
||||
'metrics_route_name' => env('PROMETHEUS_METRICS_ROUTE_NAME', 'metrics'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Metrics Route Middleware
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
<?php
|
||||
|
||||
/** @var \Illuminate\Routing\Route $route */
|
||||
$route = Route::get(
|
||||
config('prometheus.metrics_route_path'),
|
||||
\Superbalist\LaravelPrometheusExporter\MetricsController::class . '@getMetrics'
|
||||
)->name('metrics'); /** @var \Illuminate\Routing\Route $route */
|
||||
);
|
||||
|
||||
if ($name = config('prometheus.metrics_route_name')) {
|
||||
$route->name($name);
|
||||
}
|
||||
|
||||
$middleware = config('prometheus.metrics_route_middleware');
|
||||
|
||||
if ($middleware) {
|
||||
|
|
Loading…
Reference in a new issue