forked from ActiveLearningStudio/ActiveLearningStudio-API
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathprometheus.php
120 lines (101 loc) · 3.49 KB
/
prometheus.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?php
return [
/*
|--------------------------------------------------------------------------
| Namespace
|--------------------------------------------------------------------------
|
| The namespace to use as a prefix for all metrics.
|
| This will typically be the name of your project, eg: 'search'.
|
*/
'namespace' => env('PROMETHEUS_NAMESPACE', 'app'),
/*
|--------------------------------------------------------------------------
| Metrics Route Enabled?
|--------------------------------------------------------------------------
|
| If enabled, a /metrics route will be registered to export prometheus
| metrics.
|
*/
'metrics_route_enabled' => env('PROMETHEUS_METRICS_ROUTE_ENABLED', true),
/*
|--------------------------------------------------------------------------
| Metrics Route Path
|--------------------------------------------------------------------------
|
| The path at which prometheus metrics are exported.
|
| This is only applicable if metrics_route_enabled is set to true.
|
*/
'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
|--------------------------------------------------------------------------
|
| The middleware to assign to the metrics route.
|
| This can be used to protect the /metrics end-point to authenticated users,
| a specific ip address, etc.
| You are responsible for writing the middleware and implementing any
| business logic needed by your application.
|
*/
'metrics_route_middleware' => env('PROMETHEUS_METRICS_ROUTE_MIDDLEWARE'),
/*
|--------------------------------------------------------------------------
| Storage Adapter
|--------------------------------------------------------------------------
|
| The storage adapter to use.
|
| Supported: "memory", "redis", "apc"
|
*/
'storage_adapter' => env('PROMETHEUS_STORAGE_ADAPTER', 'memory'),
/*
|--------------------------------------------------------------------------
| Storage Adapters
|--------------------------------------------------------------------------
|
| The storage adapter configs.
|
*/
'storage_adapters' => [
'redis' => [
'host' => env('REDIS_HOST', 'localhost'),
'port' => env('REDIS_PORT', 6379),
'password'=> env('REDIS_PASSWORD', null),
'timeout' => 0.1,
'read_timeout' => 10,
'persistent_connections' => false,
'prefix' => env('PROMETHEUS_REDIS_PREFIX', 'PROMETHEUS_'),
],
],
/*
|--------------------------------------------------------------------------
| Collectors
|--------------------------------------------------------------------------
|
| The collectors specified here will be auto-registered in the exporter.
|
*/
'collectors' => [
// \Your\ExporterClass::class,
],
];