pulse.php 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <?php
  2. use Laravel\Pulse\Http\Middleware\Authorize;
  3. use Laravel\Pulse\Pulse;
  4. use Laravel\Pulse\Recorders;
  5. return [
  6. /*
  7. |--------------------------------------------------------------------------
  8. | Pulse Domain
  9. |--------------------------------------------------------------------------
  10. |
  11. | This is the subdomain which the Pulse dashboard will be accessible from.
  12. | When set to null, the dashboard will reside under the same domain as
  13. | the application. Remember to configure your DNS entries correctly.
  14. |
  15. */
  16. 'domain' => env('PULSE_DOMAIN'),
  17. /*
  18. |--------------------------------------------------------------------------
  19. | Pulse Path
  20. |--------------------------------------------------------------------------
  21. |
  22. | This is the path which the Pulse dashboard will be accessible from. Feel
  23. | free to change this path to anything you'd like. Note that this won't
  24. | affect the path of the internal API that is never exposed to users.
  25. |
  26. */
  27. 'path' => env('PULSE_PATH', 'pulse'),
  28. /*
  29. |--------------------------------------------------------------------------
  30. | Pulse Master Switch
  31. |--------------------------------------------------------------------------
  32. |
  33. | This configuration option may be used to completely disable all Pulse
  34. | data recorders regardless of their individual configurations. This
  35. | provides a single option to quickly disable all Pulse recording.
  36. |
  37. */
  38. 'enabled' => env('PULSE_ENABLED', false),
  39. /*
  40. |--------------------------------------------------------------------------
  41. | Pulse Storage Driver
  42. |--------------------------------------------------------------------------
  43. |
  44. | This configuration option determines which storage driver will be used
  45. | while storing entries from Pulse's recorders. In addition, you also
  46. | may provide any options to configure the selected storage driver.
  47. |
  48. */
  49. 'storage' => [
  50. 'driver' => env('PULSE_STORAGE_DRIVER', 'database'),
  51. 'trim' => [
  52. 'keep' => env('PULSE_STORAGE_KEEP', '7 days'),
  53. ],
  54. 'database' => [
  55. 'connection' => env('PULSE_DB_CONNECTION'),
  56. 'chunk' => 1000,
  57. ],
  58. ],
  59. /*
  60. |--------------------------------------------------------------------------
  61. | Pulse Ingest Driver
  62. |--------------------------------------------------------------------------
  63. |
  64. | This configuration options determines the ingest driver that will be used
  65. | to capture entries from Pulse's recorders. Ingest drivers are great to
  66. | free up your request workers quickly by offloading the data storage.
  67. |
  68. */
  69. 'ingest' => [
  70. 'driver' => env('PULSE_INGEST_DRIVER', 'storage'),
  71. 'buffer' => env('PULSE_INGEST_BUFFER', 5_000),
  72. 'trim' => [
  73. 'lottery' => [1, 1_000],
  74. 'keep' => env('PULSE_INGEST_KEEP', '7 days'),
  75. ],
  76. 'redis' => [
  77. 'connection' => env('PULSE_REDIS_CONNECTION'),
  78. 'chunk' => 1000,
  79. ],
  80. ],
  81. /*
  82. |--------------------------------------------------------------------------
  83. | Pulse Cache Driver
  84. |--------------------------------------------------------------------------
  85. |
  86. | This configuration option determines the cache driver that will be used
  87. | for various tasks, including caching dashboard results, establishing
  88. | locks for events that should only occur on one server and signals.
  89. |
  90. */
  91. 'cache' => env('PULSE_CACHE_DRIVER'),
  92. /*
  93. |--------------------------------------------------------------------------
  94. | Pulse Route Middleware
  95. |--------------------------------------------------------------------------
  96. |
  97. | These middleware will be assigned to every Pulse route, giving you the
  98. | chance to add your own middleware to this list or change any of the
  99. | existing middleware. Of course, reasonable defaults are provided.
  100. |
  101. */
  102. 'middleware' => [
  103. 'web',
  104. Authorize::class,
  105. ],
  106. /*
  107. |--------------------------------------------------------------------------
  108. | Pulse Recorders
  109. |--------------------------------------------------------------------------
  110. |
  111. | The following array lists the "recorders" that will be registered with
  112. | Pulse, along with their configuration. Recorders gather application
  113. | event data from requests and tasks to pass to your ingest driver.
  114. |
  115. */
  116. 'recorders' => [
  117. Recorders\CacheInteractions::class => [
  118. 'enabled' => env('PULSE_CACHE_INTERACTIONS_ENABLED', true),
  119. 'sample_rate' => env('PULSE_CACHE_INTERACTIONS_SAMPLE_RATE', 1),
  120. 'ignore' => [
  121. ...Pulse::defaultVendorCacheKeys(),
  122. ],
  123. 'groups' => [
  124. '/^job-exceptions:.*/' => 'job-exceptions:*',
  125. // '/:\d+/' => ':*',
  126. ],
  127. ],
  128. Recorders\Exceptions::class => [
  129. 'enabled' => env('PULSE_EXCEPTIONS_ENABLED', true),
  130. 'sample_rate' => env('PULSE_EXCEPTIONS_SAMPLE_RATE', 1),
  131. 'location' => env('PULSE_EXCEPTIONS_LOCATION', true),
  132. 'ignore' => [
  133. // '/^Package\\\\Exceptions\\\\/',
  134. ],
  135. ],
  136. Recorders\Queues::class => [
  137. 'enabled' => env('PULSE_QUEUES_ENABLED', true),
  138. 'sample_rate' => env('PULSE_QUEUES_SAMPLE_RATE', 1),
  139. 'ignore' => [
  140. // '/^Package\\\\Jobs\\\\/',
  141. ],
  142. ],
  143. Recorders\Servers::class => [
  144. 'server_name' => env('PULSE_SERVER_NAME', gethostname()),
  145. 'directories' => explode(':', env('PULSE_SERVER_DIRECTORIES', '/')),
  146. ],
  147. Recorders\SlowJobs::class => [
  148. 'enabled' => env('PULSE_SLOW_JOBS_ENABLED', true),
  149. 'sample_rate' => env('PULSE_SLOW_JOBS_SAMPLE_RATE', 1),
  150. 'threshold' => env('PULSE_SLOW_JOBS_THRESHOLD', 1000),
  151. 'ignore' => [
  152. // '/^Package\\\\Jobs\\\\/',
  153. ],
  154. ],
  155. Recorders\SlowOutgoingRequests::class => [
  156. 'enabled' => env('PULSE_SLOW_OUTGOING_REQUESTS_ENABLED', true),
  157. 'sample_rate' => env('PULSE_SLOW_OUTGOING_REQUESTS_SAMPLE_RATE', 1),
  158. 'threshold' => env('PULSE_SLOW_OUTGOING_REQUESTS_THRESHOLD', 1000),
  159. 'ignore' => [
  160. // '#^http://127\.0\.0\.1:13714#', // Inertia SSR...
  161. ],
  162. 'groups' => [
  163. // '#^https://api\.github\.com/repos/.*$#' => 'api.github.com/repos/*',
  164. // '#^https?://([^/]*).*$#' => '\1',
  165. // '#/\d+#' => '/*',
  166. ],
  167. ],
  168. Recorders\SlowQueries::class => [
  169. 'enabled' => env('PULSE_SLOW_QUERIES_ENABLED', true),
  170. 'sample_rate' => env('PULSE_SLOW_QUERIES_SAMPLE_RATE', 1),
  171. 'threshold' => env('PULSE_SLOW_QUERIES_THRESHOLD', 1000),
  172. 'location' => env('PULSE_SLOW_QUERIES_LOCATION', true),
  173. 'max_query_length' => env('PULSE_SLOW_QUERIES_MAX_QUERY_LENGTH'),
  174. 'ignore' => [
  175. '/(["`])pulse_[\w]+?\1/', // Pulse tables...
  176. '/(["`])telescope_[\w]+?\1/', // Telescope tables...
  177. ],
  178. ],
  179. Recorders\SlowRequests::class => [
  180. 'enabled' => env('PULSE_SLOW_REQUESTS_ENABLED', true),
  181. 'sample_rate' => env('PULSE_SLOW_REQUESTS_SAMPLE_RATE', 1),
  182. 'threshold' => env('PULSE_SLOW_REQUESTS_THRESHOLD', 1000),
  183. 'ignore' => [
  184. '#^/'.env('PULSE_PATH', 'pulse').'$#', // Pulse dashboard...
  185. '#^/telescope#', // Telescope dashboard...
  186. ],
  187. ],
  188. Recorders\UserJobs::class => [
  189. 'enabled' => env('PULSE_USER_JOBS_ENABLED', true),
  190. 'sample_rate' => env('PULSE_USER_JOBS_SAMPLE_RATE', 1),
  191. 'ignore' => [
  192. // '/^Package\\\\Jobs\\\\/',
  193. ],
  194. ],
  195. Recorders\UserRequests::class => [
  196. 'enabled' => env('PULSE_USER_REQUESTS_ENABLED', true),
  197. 'sample_rate' => env('PULSE_USER_REQUESTS_SAMPLE_RATE', 1),
  198. 'ignore' => [
  199. '#^/'.env('PULSE_PATH', 'pulse').'$#', // Pulse dashboard...
  200. '#^/telescope#', // Telescope dashboard...
  201. ],
  202. ],
  203. ],
  204. ];