PHP code example of machour / yii2-prometheus
1. Go to this page and download the library: Download machour/yii2-prometheus 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/ */
machour / yii2-prometheus example snippets
return [
'components' => [
'prometheusExporter' => [
'class' => 'machour\yii2\prometheus\components\Exporter',
// Point this to your collector directory. Defaults to '/var/lib/node_exporter/textfile_collector/'
// 'collectorDir' => '/var/lib/node_exporter/textfile_collector/',
// The default prom file to create if not specified in exportMetric()
// 'defaultFile' => 'yii2-prometheus-exporter.prom',
],
// ...
],
...
];