Skip to content

Commit

Permalink
Merge pull request #14 from MyIgel/use-laravel-env
Browse files Browse the repository at this point in the history
Use laravel env variables as fallback, allow to set the password
  • Loading branch information
triadev authored Jul 15, 2019
2 parents 744addd + dd18302 commit 806a085
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ This will create a file ```config/prometheus-exporter.php```.
| adapter | PROMETHEUS_ADAPTER | STRING | apc, redis, inmemory or push | apc |
| namespace | --- | STRING | default: app | app |
| namespace_http | --- | STRING | namespace for "RequestPerRoute-Middleware metrics" | http |
| redis.host | PROMETHEUS_REDIS_HOST | STRING | redis host | 127.0.0.1
| redis.port | PROMETHEUS_REDIS_PORT | INTEGER | redis port | 6379 |
| redis.host | PROMETHEUS_REDIS_HOST, REDIS_HOST | STRING | redis host | 127.0.0.1
| redis.port | PROMETHEUS_REDIS_PORT, REDIS_PORT | INTEGER | redis port | 6379 |
| redis.password | PROMETHEUS_REDIS_PASSWORD, REDIS_PASSWORD | STRING | redis password | null |
| redis.timeout | --- | FLOAT | redis timeout | 0.1 |
| redis.read_timeout | --- | INTEGER | redis read timeout | 10 |
| push_gateway.address | PROMETHEUS_PUSH_GATEWAY_ADDRESS | STRING | push gateway address | localhost:9091 |
Expand Down
5 changes: 3 additions & 2 deletions src/Config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
'namespace_http' => 'http',

'redis' => [
'host' => env('PROMETHEUS_REDIS_HOST', '127.0.0.1'),
'port' => env('PROMETHEUS_REDIS_PORT', 6379),
'host' => env('PROMETHEUS_REDIS_HOST', env('REDIS_HOST', '127.0.0.1')),
'port' => env('PROMETHEUS_REDIS_PORT', env('REDIS_PORT', 6379)),
'password' => env('PROMETHEUS_REDIS_PASSWORD', env('REDIS_PASSWORD', null)),
'timeout' => 0.1, // in seconds
'read_timeout' => 10, // in seconds
'persistent_connections' => false,
Expand Down

0 comments on commit 806a085

Please sign in to comment.