Compare commits
15 commits
Author | SHA1 | Date | |
---|---|---|---|
27059f85c7 | |||
267a1f7039 | |||
|
a581a2b145 | ||
|
f4d1481c19 | ||
|
6e874128e8 | ||
|
885f959ce9 | ||
|
39442da599 | ||
|
c1cd48549f | ||
|
c8ef2037dc | ||
|
4174a30cd5 | ||
|
d6ec61c8bc | ||
|
ae1f632ebe | ||
|
dfad472756 | ||
|
26842ebdb7 | ||
|
c0c0258cde |
7 changed files with 65 additions and 18 deletions
|
@ -4,7 +4,8 @@ php:
|
|||
- 5.6
|
||||
- 7.0
|
||||
- 7.1
|
||||
- nightly
|
||||
- 7.2
|
||||
- 7.3
|
||||
|
||||
before_install:
|
||||
- echo "extension = redis.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
|
||||
|
@ -12,4 +13,4 @@ before_install:
|
|||
before_script:
|
||||
- composer install
|
||||
|
||||
script: ./vendor/bin/phpunit --configuration phpunit.xml
|
||||
script: ./vendor/bin/phpunit --configuration phpunit.xml
|
||||
|
|
|
@ -2,13 +2,6 @@
|
|||
|
||||
A prometheus exporter for Laravel.
|
||||
|
||||
[![Author](http://img.shields.io/badge/author-@superbalist-blue.svg?style=flat-square)](https://twitter.com/superbalist)
|
||||
[![Build Status](https://img.shields.io/travis/Superbalist/laravel-prometheus-exporter/master.svg?style=flat-square)](https://travis-ci.org/Superbalist/laravel-prometheus-exporter)
|
||||
[![StyleCI](https://styleci.io/repos/98516814/shield?branch=master)](https://styleci.io/repos/98516814)
|
||||
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)
|
||||
[![Packagist Version](https://img.shields.io/packagist/v/superbalist/laravel-prometheus-exporter.svg?style=flat-square)](https://packagist.org/packages/superbalist/laravel-prometheus-exporter)
|
||||
[![Total Downloads](https://img.shields.io/packagist/dt/superbalist/laravel-prometheus-exporter.svg?style=flat-square)](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
|
||||
|
|
23
changelog.md
23
changelog.md
|
@ -1,5 +1,26 @@
|
|||
# Changelog
|
||||
|
||||
## 1.0.5 - 2020-03-16
|
||||
|
||||
* Update call to array_get helper to use the Illuminate\Support\Arr class
|
||||
* Enable Laravel 7 compatability
|
||||
|
||||
## 1.0.4 - 2019-10-17
|
||||
|
||||
* Enable Laravel 6.0 compatability
|
||||
|
||||
## 1.0.3 - 2019-02-11
|
||||
|
||||
* Enable package discovery for laravel 5.5+
|
||||
|
||||
## 1.0.2 - 2019-01-16
|
||||
|
||||
* Add compatability with Laravel Lumen (make named route configurable)
|
||||
|
||||
## 1.0.1 - 2017-08-30
|
||||
|
||||
* Fix config retrieval of `prometheus.storage_adapters`
|
||||
|
||||
## 1.0.0 - 2017-07-27
|
||||
|
||||
* Initial release
|
||||
* Initial release
|
||||
|
|
|
@ -6,13 +6,17 @@
|
|||
{
|
||||
"name": "Superbalist.com a division of Takealot Online (Pty) Ltd",
|
||||
"email": "info@superbalist.com"
|
||||
},
|
||||
{
|
||||
"name": "Sirius",
|
||||
"email": "sirius@wir-sind-auch-menschen.de"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.6.0",
|
||||
"illuminate/support": "^5.3",
|
||||
"illuminate/routing": "^5.3",
|
||||
"jimdo/prometheus_client_php": "^0.9.0"
|
||||
"php": "^7.4|^8.0",
|
||||
"illuminate/support": "^7.0 || ^8.0 || ^9.0",
|
||||
"illuminate/routing": "^7.0 || ^8.0 || ^9.0",
|
||||
"promphp/prometheus_client_php": "^v2.4"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
@ -23,10 +27,18 @@
|
|||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0-dev"
|
||||
},
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Superbalist\\LaravelPrometheusExporter\\PrometheusServiceProvider"
|
||||
],
|
||||
"aliases": {
|
||||
"Prometheus": "Superbalist\\LaravelPrometheusExporter\\PrometheusFacade"
|
||||
}
|
||||
}
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^5.5",
|
||||
"mockery/mockery": "^0.9.5"
|
||||
"phpunit/phpunit": "^9.5",
|
||||
"mockery/mockery": "^1.5"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Superbalist\LaravelPrometheusExporter;
|
||||
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Prometheus\CollectorRegistry;
|
||||
use Prometheus\Storage\Adapter;
|
||||
|
@ -50,7 +51,7 @@ class PrometheusServiceProvider extends ServiceProvider
|
|||
$factory = $app['prometheus.storage_adapter_factory']; /** @var StorageAdapterFactory $factory */
|
||||
$driver = config('prometheus.storage_adapter');
|
||||
$configs = config('prometheus.storage_adapters');
|
||||
$config = array_get($configs, $driver, []);
|
||||
$config = Arr::get($configs, $driver, []);
|
||||
return $factory->make($driver, $config);
|
||||
});
|
||||
$this->app->alias(Adapter::class, 'prometheus.storage_adapter');
|
||||
|
|
|
@ -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