1. Go to this page and download the library: Download ensi/laravel-metrics 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/ */
return [
'ignore_commands' => [
'kafka:consume',
],
'ignore_routes' => [
'prometheus.*'
],
'http_requests_stats_groups' => [
'<stats-group-name>' => [
// If your app runs in multiple containers and each of them is responsible for its own metrics,
// then you don't need to use the "summary"
'type' => 'summary',
'route_names' => ['*'], // or use prefix, like ['catalog.*', 'profile.favorites'],
'time_window' => 30,
'quantiles' => [0.5, 0.75, ,0.95],
],
'<stats-group-name>' => [
'type' => 'histogram',
'route_names' => ['*'], // or use prefix, like ['catalog.*', 'profile.favorites'],
'buckets' => [0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10],
],
]
];