| 199 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
return [
|
|
|
4 |
|
|
|
5 |
/*
|
|
|
6 |
|------------------------------------------------------------------------------------------------------------------
|
|
|
7 |
| Enable Clockwork
|
|
|
8 |
|------------------------------------------------------------------------------------------------------------------
|
|
|
9 |
|
|
|
|
10 |
| Clockwork is enabled by default only when your application is in debug mode. Here you can explicitly enable or
|
|
|
11 |
| disable Clockwork. When disabled, no data is collected and the api and web ui are inactive.
|
|
|
12 |
|
|
|
|
13 |
*/
|
|
|
14 |
|
|
|
15 |
'enable' => env('CLOCKWORK_ENABLE', null),
|
|
|
16 |
|
|
|
17 |
/*
|
|
|
18 |
|------------------------------------------------------------------------------------------------------------------
|
|
|
19 |
| Features
|
|
|
20 |
|------------------------------------------------------------------------------------------------------------------
|
|
|
21 |
|
|
|
|
22 |
| You can enable or disable various Clockwork features here. Some features have additional settings (eg. slow query
|
|
|
23 |
| threshold for database queries).
|
|
|
24 |
|
|
|
|
25 |
*/
|
|
|
26 |
|
|
|
27 |
'features' => [
|
|
|
28 |
|
|
|
29 |
// Cache usage stats and cache queries including results
|
|
|
30 |
'cache' => [
|
|
|
31 |
'enabled' => env('CLOCKWORK_CACHE_ENABLED', true),
|
|
|
32 |
|
|
|
33 |
// Collect cache queries
|
|
|
34 |
'collect_queries' => env('CLOCKWORK_CACHE_QUERIES', true),
|
|
|
35 |
|
|
|
36 |
// Collect values from cache queries (high performance impact with a very high number of queries)
|
|
|
37 |
'collect_values' => env('CLOCKWORK_CACHE_COLLECT_VALUES', false)
|
|
|
38 |
],
|
|
|
39 |
|
|
|
40 |
// Database usage stats and queries
|
|
|
41 |
'database' => [
|
|
|
42 |
'enabled' => env('CLOCKWORK_DATABASE_ENABLED', true),
|
|
|
43 |
|
|
|
44 |
// Collect database queries (high performance impact with a very high number of queries)
|
|
|
45 |
'collect_queries' => env('CLOCKWORK_DATABASE_COLLECT_QUERIES', true),
|
|
|
46 |
|
|
|
47 |
// Collect details of models updates (high performance impact with a lot of model updates)
|
|
|
48 |
'collect_models_actions' => env('CLOCKWORK_DATABASE_COLLECT_MODELS_ACTIONS', true),
|
|
|
49 |
|
|
|
50 |
// Collect details of retrieved models (very high performance impact with a lot of models retrieved)
|
|
|
51 |
'collect_models_retrieved' => env('CLOCKWORK_DATABASE_COLLECT_MODELS_RETRIEVED', false),
|
|
|
52 |
|
|
|
53 |
// Query execution time threshold in milliseconds after which the query will be marked as slow
|
|
|
54 |
'slow_threshold' => env('CLOCKWORK_DATABASE_SLOW_THRESHOLD'),
|
|
|
55 |
|
|
|
56 |
// Collect only slow database queries
|
|
|
57 |
'slow_only' => env('CLOCKWORK_DATABASE_SLOW_ONLY', false),
|
|
|
58 |
|
|
|
59 |
// Detect and report duplicate queries
|
|
|
60 |
'detect_duplicate_queries' => env('CLOCKWORK_DATABASE_DETECT_DUPLICATE_QUERIES', false)
|
|
|
61 |
],
|
|
|
62 |
|
|
|
63 |
// Dispatched events
|
|
|
64 |
'events' => [
|
|
|
65 |
'enabled' => env('CLOCKWORK_EVENTS_ENABLED', true),
|
|
|
66 |
|
|
|
67 |
// Ignored events (framework events are ignored by default)
|
|
|
68 |
'ignored_events' => [
|
|
|
69 |
// App\Events\UserRegistered::class,
|
|
|
70 |
// 'user.registered'
|
|
|
71 |
],
|
|
|
72 |
],
|
|
|
73 |
|
|
|
74 |
// Laravel log (you can still log directly to Clockwork with laravel log disabled)
|
|
|
75 |
'log' => [
|
|
|
76 |
'enabled' => env('CLOCKWORK_LOG_ENABLED', true)
|
|
|
77 |
],
|
|
|
78 |
|
|
|
79 |
// Sent notifications
|
|
|
80 |
'notifications' => [
|
|
|
81 |
'enabled' => env('CLOCKWORK_NOTIFICATIONS_ENABLED', true),
|
|
|
82 |
],
|
|
|
83 |
|
|
|
84 |
// Performance metrics
|
|
|
85 |
'performance' => [
|
|
|
86 |
// Allow collecting of client metrics. Requires separate clockwork-browser npm package.
|
|
|
87 |
'client_metrics' => env('CLOCKWORK_PERFORMANCE_CLIENT_METRICS', true)
|
|
|
88 |
],
|
|
|
89 |
|
|
|
90 |
// Dispatched queue jobs
|
|
|
91 |
'queue' => [
|
|
|
92 |
'enabled' => env('CLOCKWORK_QUEUE_ENABLED', true)
|
|
|
93 |
],
|
|
|
94 |
|
|
|
95 |
// Redis commands
|
|
|
96 |
'redis' => [
|
|
|
97 |
'enabled' => env('CLOCKWORK_REDIS_ENABLED', true)
|
|
|
98 |
],
|
|
|
99 |
|
|
|
100 |
// Routes list
|
|
|
101 |
'routes' => [
|
|
|
102 |
'enabled' => env('CLOCKWORK_ROUTES_ENABLED', false),
|
|
|
103 |
|
|
|
104 |
// Collect only routes from particular namespaces (only application routes by default)
|
|
|
105 |
'only_namespaces' => [ 'App' ]
|
|
|
106 |
],
|
|
|
107 |
|
|
|
108 |
// Rendered views
|
|
|
109 |
'views' => [
|
|
|
110 |
'enabled' => env('CLOCKWORK_VIEWS_ENABLED', true),
|
|
|
111 |
|
|
|
112 |
// Collect views including view data (high performance impact with a high number of views)
|
|
|
113 |
'collect_data' => env('CLOCKWORK_VIEWS_COLLECT_DATA', false),
|
|
|
114 |
|
|
|
115 |
// Use Twig profiler instead of Laravel events for apps using laravel-twigbridge (more precise, but does
|
|
|
116 |
// not support collecting view data)
|
|
|
117 |
'use_twig_profiler' => env('CLOCKWORK_VIEWS_USE_TWIG_PROFILER', false)
|
|
|
118 |
]
|
|
|
119 |
|
|
|
120 |
],
|
|
|
121 |
|
|
|
122 |
/*
|
|
|
123 |
|------------------------------------------------------------------------------------------------------------------
|
|
|
124 |
| Enable web UI
|
|
|
125 |
|------------------------------------------------------------------------------------------------------------------
|
|
|
126 |
|
|
|
|
127 |
| Clockwork comes with a web UI accessible via http://your.app/clockwork. Here you can enable or disable this
|
|
|
128 |
| feature. You can also set a custom path for the web UI.
|
|
|
129 |
|
|
|
|
130 |
*/
|
|
|
131 |
|
|
|
132 |
'web' => env('CLOCKWORK_WEB', true),
|
|
|
133 |
|
|
|
134 |
/*
|
|
|
135 |
|------------------------------------------------------------------------------------------------------------------
|
|
|
136 |
| Enable toolbar
|
|
|
137 |
|------------------------------------------------------------------------------------------------------------------
|
|
|
138 |
|
|
|
|
139 |
| Clockwork can show a toolbar with basic metrics on all responses. Here you can enable or disable this feature.
|
|
|
140 |
| Requires a separate clockwork-browser npm library.
|
|
|
141 |
| For installation instructions see https://underground.works/clockwork/#docs-viewing-data
|
|
|
142 |
|
|
|
|
143 |
*/
|
|
|
144 |
|
|
|
145 |
'toolbar' => env('CLOCKWORK_TOOLBAR', true),
|
|
|
146 |
|
|
|
147 |
/*
|
|
|
148 |
|------------------------------------------------------------------------------------------------------------------
|
|
|
149 |
| HTTP requests collection
|
|
|
150 |
|------------------------------------------------------------------------------------------------------------------
|
|
|
151 |
|
|
|
|
152 |
| Clockwork collects data about HTTP requests to your app. Here you can choose which requests should be collected.
|
|
|
153 |
|
|
|
|
154 |
*/
|
|
|
155 |
|
|
|
156 |
'requests' => [
|
|
|
157 |
// With on-demand mode enabled, Clockwork will only profile requests when the browser extension is open or you
|
|
|
158 |
// manually pass a "clockwork-profile" cookie or get/post data key.
|
|
|
159 |
// Optionally you can specify a "secret" that has to be passed as the value to enable profiling.
|
|
|
160 |
'on_demand' => env('CLOCKWORK_REQUESTS_ON_DEMAND', false),
|
|
|
161 |
|
|
|
162 |
// Collect only errors (requests with HTTP 4xx and 5xx responses)
|
|
|
163 |
'errors_only' => env('CLOCKWORK_REQUESTS_ERRORS_ONLY', false),
|
|
|
164 |
|
|
|
165 |
// Response time threshold in milliseconds after which the request will be marked as slow
|
|
|
166 |
'slow_threshold' => env('CLOCKWORK_REQUESTS_SLOW_THRESHOLD'),
|
|
|
167 |
|
|
|
168 |
// Collect only slow requests
|
|
|
169 |
'slow_only' => env('CLOCKWORK_REQUESTS_SLOW_ONLY', false),
|
|
|
170 |
|
|
|
171 |
// Sample the collected requests (e.g. set to 100 to collect only 1 in 100 requests)
|
|
|
172 |
'sample' => env('CLOCKWORK_REQUESTS_SAMPLE', false),
|
|
|
173 |
|
|
|
174 |
// List of URIs that should not be collected
|
|
|
175 |
'except' => [
|
|
|
176 |
'/horizon/.*', // Laravel Horizon requests
|
|
|
177 |
'/telescope/.*', // Laravel Telescope requests
|
|
|
178 |
'/_debugbar/.*', // Laravel DebugBar requests
|
|
|
179 |
],
|
|
|
180 |
|
|
|
181 |
// List of URIs that should be collected, any other URI will not be collected if not empty
|
|
|
182 |
'only' => [
|
|
|
183 |
// '/api/.*'
|
|
|
184 |
],
|
|
|
185 |
|
|
|
186 |
// Don't collect OPTIONS requests, mostly used in the CSRF pre-flight requests and are rarely of interest
|
|
|
187 |
'except_preflight' => env('CLOCKWORK_REQUESTS_EXCEPT_PREFLIGHT', true)
|
|
|
188 |
],
|
|
|
189 |
|
|
|
190 |
/*
|
|
|
191 |
|------------------------------------------------------------------------------------------------------------------
|
|
|
192 |
| Artisan commands collection
|
|
|
193 |
|------------------------------------------------------------------------------------------------------------------
|
|
|
194 |
|
|
|
|
195 |
| Clockwork can collect data about executed artisan commands. Here you can enable and configure which commands
|
|
|
196 |
| should be collected.
|
|
|
197 |
|
|
|
|
198 |
*/
|
|
|
199 |
|
|
|
200 |
'artisan' => [
|
|
|
201 |
// Enable or disable collection of executed Artisan commands
|
|
|
202 |
'collect' => env('CLOCKWORK_ARTISAN_COLLECT', false),
|
|
|
203 |
|
|
|
204 |
// List of commands that should not be collected (built-in commands are not collected by default)
|
|
|
205 |
'except' => [
|
|
|
206 |
// 'inspire'
|
|
|
207 |
],
|
|
|
208 |
|
|
|
209 |
// List of commands that should be collected, any other command will not be collected if not empty
|
|
|
210 |
'only' => [
|
|
|
211 |
// 'inspire'
|
|
|
212 |
],
|
|
|
213 |
|
|
|
214 |
// Enable or disable collection of command output
|
|
|
215 |
'collect_output' => env('CLOCKWORK_ARTISAN_COLLECT_OUTPUT', false),
|
|
|
216 |
|
|
|
217 |
// Enable or disable collection of built-in Laravel commands
|
|
|
218 |
'except_laravel_commands' => env('CLOCKWORK_ARTISAN_EXCEPT_LARAVEL_COMMANDS', true)
|
|
|
219 |
],
|
|
|
220 |
|
|
|
221 |
/*
|
|
|
222 |
|------------------------------------------------------------------------------------------------------------------
|
|
|
223 |
| Queue jobs collection
|
|
|
224 |
|------------------------------------------------------------------------------------------------------------------
|
|
|
225 |
|
|
|
|
226 |
| Clockwork can collect data about executed queue jobs. Here you can enable and configure which queue jobs should
|
|
|
227 |
| be collected.
|
|
|
228 |
|
|
|
|
229 |
*/
|
|
|
230 |
|
|
|
231 |
'queue' => [
|
|
|
232 |
// Enable or disable collection of executed queue jobs
|
|
|
233 |
'collect' => env('CLOCKWORK_QUEUE_COLLECT', false),
|
|
|
234 |
|
|
|
235 |
// List of queue jobs that should not be collected
|
|
|
236 |
'except' => [
|
|
|
237 |
// App\Jobs\ExpensiveJob::class
|
|
|
238 |
],
|
|
|
239 |
|
|
|
240 |
// List of queue jobs that should be collected, any other queue job will not be collected if not empty
|
|
|
241 |
'only' => [
|
|
|
242 |
// App\Jobs\BuggyJob::class
|
|
|
243 |
]
|
|
|
244 |
],
|
|
|
245 |
|
|
|
246 |
/*
|
|
|
247 |
|------------------------------------------------------------------------------------------------------------------
|
|
|
248 |
| Tests collection
|
|
|
249 |
|------------------------------------------------------------------------------------------------------------------
|
|
|
250 |
|
|
|
|
251 |
| Clockwork can collect data about executed tests. Here you can enable and configure which tests should be
|
|
|
252 |
| collected.
|
|
|
253 |
|
|
|
|
254 |
*/
|
|
|
255 |
|
|
|
256 |
'tests' => [
|
|
|
257 |
// Enable or disable collection of ran tests
|
|
|
258 |
'collect' => env('CLOCKWORK_TESTS_COLLECT', false),
|
|
|
259 |
|
|
|
260 |
// List of tests that should not be collected
|
|
|
261 |
'except' => [
|
|
|
262 |
// Tests\Unit\ExampleTest::class
|
|
|
263 |
]
|
|
|
264 |
],
|
|
|
265 |
|
|
|
266 |
/*
|
|
|
267 |
|------------------------------------------------------------------------------------------------------------------
|
|
|
268 |
| Enable data collection when Clockwork is disabled
|
|
|
269 |
|------------------------------------------------------------------------------------------------------------------
|
|
|
270 |
|
|
|
|
271 |
| You can enable this setting to collect data even when Clockwork is disabled, e.g. for future analysis.
|
|
|
272 |
|
|
|
|
273 |
*/
|
|
|
274 |
|
|
|
275 |
'collect_data_always' => env('CLOCKWORK_COLLECT_DATA_ALWAYS', false),
|
|
|
276 |
|
|
|
277 |
/*
|
|
|
278 |
|------------------------------------------------------------------------------------------------------------------
|
|
|
279 |
| Metadata storage
|
|
|
280 |
|------------------------------------------------------------------------------------------------------------------
|
|
|
281 |
|
|
|
|
282 |
| Configure how is the metadata collected by Clockwork stored. Two options are available:
|
|
|
283 |
| - files - A simple fast storage implementation storing data in one-per-request files.
|
|
|
284 |
| - sql - Stores requests in a sql database. Supports MySQL, PostgreSQL and SQLite. Requires PDO.
|
|
|
285 |
|
|
|
|
286 |
*/
|
|
|
287 |
|
|
|
288 |
'storage' => env('CLOCKWORK_STORAGE', 'files'),
|
|
|
289 |
|
|
|
290 |
// Path where the Clockwork metadata is stored
|
|
|
291 |
'storage_files_path' => env('CLOCKWORK_STORAGE_FILES_PATH', storage_path('clockwork')),
|
|
|
292 |
|
|
|
293 |
// Compress the metadata files using gzip, trading a little bit of performance for lower disk usage
|
|
|
294 |
'storage_files_compress' => env('CLOCKWORK_STORAGE_FILES_COMPRESS', false),
|
|
|
295 |
|
|
|
296 |
// SQL database to use, can be a name of database configured in database.php or a path to a SQLite file
|
|
|
297 |
'storage_sql_database' => env('CLOCKWORK_STORAGE_SQL_DATABASE', storage_path('clockwork.sqlite')),
|
|
|
298 |
|
|
|
299 |
// SQL table name to use, the table is automatically created and updated when needed
|
|
|
300 |
'storage_sql_table' => env('CLOCKWORK_STORAGE_SQL_TABLE', 'clockwork'),
|
|
|
301 |
|
|
|
302 |
// Maximum lifetime of collected metadata in minutes, older requests will automatically be deleted, false to disable
|
|
|
303 |
'storage_expiration' => env('CLOCKWORK_STORAGE_EXPIRATION', 60 * 24 * 7),
|
|
|
304 |
|
|
|
305 |
/*
|
|
|
306 |
|------------------------------------------------------------------------------------------------------------------
|
|
|
307 |
| Authentication
|
|
|
308 |
|------------------------------------------------------------------------------------------------------------------
|
|
|
309 |
|
|
|
|
310 |
| Clockwork can be configured to require authentication before allowing access to the collected data. This might be
|
|
|
311 |
| useful when the application is publicly accessible. Setting to true will enable a simple authentication with a
|
|
|
312 |
| pre-configured password. You can also pass a class name of a custom implementation.
|
|
|
313 |
|
|
|
|
314 |
*/
|
|
|
315 |
|
|
|
316 |
'authentication' => env('CLOCKWORK_AUTHENTICATION', false),
|
|
|
317 |
|
|
|
318 |
// Password for the simple authentication
|
|
|
319 |
'authentication_password' => env('CLOCKWORK_AUTHENTICATION_PASSWORD', 'VerySecretPassword'),
|
|
|
320 |
|
|
|
321 |
/*
|
|
|
322 |
|------------------------------------------------------------------------------------------------------------------
|
|
|
323 |
| Stack traces collection
|
|
|
324 |
|------------------------------------------------------------------------------------------------------------------
|
|
|
325 |
|
|
|
|
326 |
| Clockwork can collect stack traces for log messages and certain data like database queries. Here you can set
|
|
|
327 |
| whether to collect stack traces, limit the number of collected frames and set further configuration. Collecting
|
|
|
328 |
| long stack traces considerably increases metadata size.
|
|
|
329 |
|
|
|
|
330 |
*/
|
|
|
331 |
|
|
|
332 |
'stack_traces' => [
|
|
|
333 |
// Enable or disable collecting of stack traces
|
|
|
334 |
'enabled' => env('CLOCKWORK_STACK_TRACES_ENABLED', true),
|
|
|
335 |
|
|
|
336 |
// Limit the number of frames to be collected
|
|
|
337 |
'limit' => env('CLOCKWORK_STACK_TRACES_LIMIT', 10),
|
|
|
338 |
|
|
|
339 |
// List of vendor names to skip when determining caller, common vendors are automatically added
|
|
|
340 |
'skip_vendors' => [
|
|
|
341 |
// 'phpunit'
|
|
|
342 |
],
|
|
|
343 |
|
|
|
344 |
// List of namespaces to skip when determining caller
|
|
|
345 |
'skip_namespaces' => [
|
|
|
346 |
// 'Laravel'
|
|
|
347 |
],
|
|
|
348 |
|
|
|
349 |
// List of class names to skip when determining caller
|
|
|
350 |
'skip_classes' => [
|
|
|
351 |
// App\CustomLog::class
|
|
|
352 |
]
|
|
|
353 |
|
|
|
354 |
],
|
|
|
355 |
|
|
|
356 |
/*
|
|
|
357 |
|------------------------------------------------------------------------------------------------------------------
|
|
|
358 |
| Serialization
|
|
|
359 |
|------------------------------------------------------------------------------------------------------------------
|
|
|
360 |
|
|
|
|
361 |
| Clockwork serializes the collected data to json for storage and transfer. Here you can configure certain aspects
|
|
|
362 |
| of serialization. Serialization has a large effect on the cpu time and memory usage.
|
|
|
363 |
|
|
|
|
364 |
*/
|
|
|
365 |
|
|
|
366 |
// Maximum depth of serialized multi-level arrays and objects
|
|
|
367 |
'serialization_depth' => env('CLOCKWORK_SERIALIZATION_DEPTH', 10),
|
|
|
368 |
|
|
|
369 |
// A list of classes that will never be serialized (e.g. a common service container class)
|
|
|
370 |
'serialization_blackbox' => [
|
|
|
371 |
\Illuminate\Container\Container::class,
|
|
|
372 |
\Illuminate\Foundation\Application::class,
|
|
|
373 |
\Laravel\Lumen\Application::class
|
|
|
374 |
],
|
|
|
375 |
|
|
|
376 |
/*
|
|
|
377 |
|------------------------------------------------------------------------------------------------------------------
|
|
|
378 |
| Register helpers
|
|
|
379 |
|------------------------------------------------------------------------------------------------------------------
|
|
|
380 |
|
|
|
|
381 |
| Clockwork comes with a "clock" global helper function. You can use this helper to quickly log something and to
|
|
|
382 |
| access the Clockwork instance.
|
|
|
383 |
|
|
|
|
384 |
*/
|
|
|
385 |
|
|
|
386 |
'register_helpers' => env('CLOCKWORK_REGISTER_HELPERS', true),
|
|
|
387 |
|
|
|
388 |
/*
|
|
|
389 |
|------------------------------------------------------------------------------------------------------------------
|
|
|
390 |
| Send headers for AJAX request
|
|
|
391 |
|------------------------------------------------------------------------------------------------------------------
|
|
|
392 |
|
|
|
|
393 |
| When trying to collect data, the AJAX method can sometimes fail if it is missing required headers. For example, an
|
|
|
394 |
| API might require a version number using Accept headers to route the HTTP request to the correct codebase.
|
|
|
395 |
|
|
|
|
396 |
*/
|
|
|
397 |
|
|
|
398 |
'headers' => [
|
|
|
399 |
// 'Accept' => 'application/vnd.com.whatever.v1+json',
|
|
|
400 |
],
|
|
|
401 |
|
|
|
402 |
/*
|
|
|
403 |
|------------------------------------------------------------------------------------------------------------------
|
|
|
404 |
| Server timing
|
|
|
405 |
|------------------------------------------------------------------------------------------------------------------
|
|
|
406 |
|
|
|
|
407 |
| Clockwork supports the W3C Server Timing specification, which allows for collecting a simple performance metrics
|
|
|
408 |
| in a cross-browser way. E.g. in Chrome, your app, database and timeline event timings will be shown in the Dev
|
|
|
409 |
| Tools network tab. This setting specifies the max number of timeline events that will be sent. Setting to false
|
|
|
410 |
| will disable the feature.
|
|
|
411 |
|
|
|
|
412 |
*/
|
|
|
413 |
|
|
|
414 |
'server_timing' => env('CLOCKWORK_SERVER_TIMING', 10)
|
|
|
415 |
|
|
|
416 |
];
|