adonisjs-server-stats 1.10.0 → 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (248) hide show
  1. package/README.md +23 -14
  2. package/dist/core/config-utils.d.ts +8 -0
  3. package/dist/core/constants.d.ts +4 -0
  4. package/dist/core/dashboard-data-controller.d.ts +16 -0
  5. package/dist/core/dashboard-data-helpers.d.ts +12 -0
  6. package/dist/core/debug-data-controller.d.ts +4 -0
  7. package/dist/core/define-config-helpers.d.ts +25 -0
  8. package/dist/core/feature-detect-helpers.d.ts +36 -0
  9. package/dist/core/field-resolvers.d.ts +64 -0
  10. package/dist/core/formatters-helpers.d.ts +23 -0
  11. package/dist/core/formatters.d.ts +15 -0
  12. package/dist/core/index.d.ts +1 -1
  13. package/dist/core/index.js +599 -509
  14. package/dist/core/log-utils-helpers.d.ts +13 -0
  15. package/dist/core/metrics.d.ts +3 -28
  16. package/dist/core/pagination.d.ts +0 -9
  17. package/dist/core/server-stats-controller.d.ts +6 -0
  18. package/dist/core/transmit-helpers.d.ts +7 -0
  19. package/dist/core/types-dashboard.d.ts +178 -0
  20. package/dist/core/types-diagnostics.d.ts +85 -0
  21. package/dist/core/types.d.ts +10 -442
  22. package/dist/react/CacheSection-BYN53kYO.js +135 -0
  23. package/dist/react/CacheStatsBar-CRodCOeP.js +27 -0
  24. package/dist/react/CacheTab-DOhuK05d.js +106 -0
  25. package/dist/react/{ConfigSection-DfFd-WRq.js → ConfigSection-B9EHh4Rp.js} +1 -1
  26. package/dist/react/{ConfigTab-Bdg8YMer.js → ConfigTab-C8kriE2b.js} +1 -1
  27. package/dist/react/CustomPaneTab-CvzQS_Wh.js +99 -0
  28. package/dist/react/EmailPreviewOverlay-BmXOAvqG.js +58 -0
  29. package/dist/react/EmailsSection-BJyFJf7A.js +226 -0
  30. package/dist/react/EmailsTab-Ch8jp10B.js +110 -0
  31. package/dist/react/{EventsSection-ByQ-9blq.js → EventsSection-DJPwHeT8.js} +28 -27
  32. package/dist/react/EventsTab-B-FoehXC.js +58 -0
  33. package/dist/react/{FilterBar-DQRXpWrb.js → FilterBar-CQ7bD669.js} +15 -15
  34. package/dist/react/{InternalsContent-DBzsI0CG.js → InternalsContent-O8ino9oM.js} +133 -109
  35. package/dist/react/InternalsSection-B6VlVx5f.js +22 -0
  36. package/dist/react/InternalsTab-CkEKpRMU.js +17 -0
  37. package/dist/react/JobStatsBar-C7RslAFE.js +30 -0
  38. package/dist/react/JobsSection-DWF4i1t_.js +167 -0
  39. package/dist/react/JobsTab-DqnifQXV.js +129 -0
  40. package/dist/react/LogEntryRow-CMMkqA9M.js +43 -0
  41. package/dist/react/LogsSection-C1xC5aP4.js +198 -0
  42. package/dist/react/LogsTab-CS4sLfLw.js +79 -0
  43. package/dist/react/{OverviewSection-C4T1ur51.js → OverviewSection-CxvfOR0v.js} +70 -80
  44. package/dist/react/QueriesSection-CrMdU5Ax.js +458 -0
  45. package/dist/react/{QueriesTab-osLUWd4L.js → QueriesTab-x85PjkyS.js} +38 -40
  46. package/dist/react/RequestsSection-DETN9oZb.js +321 -0
  47. package/dist/react/{RoutesSection-BUSkM6PY.js → RoutesSection-CmorkJeC.js} +2 -2
  48. package/dist/react/RoutesTab-CbzBOzpc.js +68 -0
  49. package/dist/react/SplitPaneWrapper-BiIgT4ND.js +49 -0
  50. package/dist/react/TimeAgoCell-o3KigGfM.js +8 -0
  51. package/dist/react/{TimelineTab-Covg5weo.js → TimelineTab-Ue9tUD_n.js} +76 -102
  52. package/dist/react/index-DwDK-4oX.js +1121 -0
  53. package/dist/react/index.js +6 -6
  54. package/dist/react/react/components/shared/CacheStatsBar.d.ts +13 -0
  55. package/dist/react/react/components/shared/EmailPreviewOverlay.d.ts +29 -0
  56. package/dist/react/react/components/{Dashboard/shared → shared}/FilterBar.d.ts +4 -3
  57. package/dist/react/react/components/shared/JobStatsBar.d.ts +12 -0
  58. package/dist/react/react/components/shared/LogEntryRow.d.ts +9 -0
  59. package/dist/react/react/components/shared/RelatedLogs.d.ts +2 -2
  60. package/dist/react/react/components/shared/SplitPaneWrapper.d.ts +7 -0
  61. package/dist/react/react/components/shared/TimeAgoCell.d.ts +17 -0
  62. package/dist/react/react/hooks/useDashboardData.d.ts +4 -8
  63. package/dist/react/react/hooks/useDiagnosticsData.d.ts +14 -0
  64. package/dist/react/style.css +1 -1
  65. package/dist/src/collectors/app_collector.d.ts +0 -8
  66. package/dist/src/collectors/app_collector.js +45 -52
  67. package/dist/src/collectors/auto_detect.d.ts +0 -23
  68. package/dist/src/collectors/auto_detect.js +33 -55
  69. package/dist/src/collectors/db_pool_collector.d.ts +14 -16
  70. package/dist/src/collectors/db_pool_collector.js +72 -57
  71. package/dist/src/collectors/log_collector.d.ts +0 -47
  72. package/dist/src/collectors/log_collector.js +36 -65
  73. package/dist/src/collectors/queue_collector.d.ts +0 -20
  74. package/dist/src/collectors/queue_collector.js +60 -76
  75. package/dist/src/collectors/redis_collector.d.ts +10 -10
  76. package/dist/src/collectors/redis_collector.js +69 -66
  77. package/dist/src/config/deprecation_migration.d.ts +7 -0
  78. package/dist/src/config/deprecation_migration.js +201 -0
  79. package/dist/src/controller/debug_controller.d.ts +1 -1
  80. package/dist/src/controller/debug_controller.js +87 -81
  81. package/dist/src/dashboard/cache_handlers.d.ts +14 -0
  82. package/dist/src/dashboard/cache_handlers.js +52 -0
  83. package/dist/src/dashboard/chart_aggregator.d.ts +0 -7
  84. package/dist/src/dashboard/chart_aggregator.js +68 -50
  85. package/dist/src/dashboard/coalesce_cache.d.ts +25 -0
  86. package/dist/src/dashboard/coalesce_cache.js +47 -0
  87. package/dist/src/dashboard/dashboard_controller.d.ts +11 -37
  88. package/dist/src/dashboard/dashboard_controller.js +51 -544
  89. package/dist/src/dashboard/dashboard_page_assets.d.ts +17 -0
  90. package/dist/src/dashboard/dashboard_page_assets.js +51 -0
  91. package/dist/src/dashboard/dashboard_store.d.ts +19 -218
  92. package/dist/src/dashboard/dashboard_store.js +115 -1116
  93. package/dist/src/dashboard/dashboard_types.d.ts +83 -0
  94. package/dist/src/dashboard/dashboard_types.js +4 -0
  95. package/dist/src/dashboard/detail_queries.d.ts +19 -0
  96. package/dist/src/dashboard/detail_queries.js +98 -0
  97. package/dist/src/dashboard/email_event_builder.d.ts +8 -0
  98. package/dist/src/dashboard/email_event_builder.js +65 -0
  99. package/dist/src/dashboard/explain_query.d.ts +8 -0
  100. package/dist/src/dashboard/explain_query.js +22 -0
  101. package/dist/src/dashboard/filter_handlers.d.ts +23 -0
  102. package/dist/src/dashboard/filter_handlers.js +56 -0
  103. package/dist/src/dashboard/filtered_queries.d.ts +15 -0
  104. package/dist/src/dashboard/filtered_queries.js +155 -0
  105. package/dist/src/dashboard/flush_manager.d.ts +25 -0
  106. package/dist/src/dashboard/flush_manager.js +107 -0
  107. package/dist/src/dashboard/format_helpers.d.ts +126 -0
  108. package/dist/src/dashboard/format_helpers.js +140 -0
  109. package/dist/src/dashboard/inspector_manager.d.ts +36 -0
  110. package/dist/src/dashboard/inspector_manager.js +102 -0
  111. package/dist/src/dashboard/integrations/config_inspector.js +11 -13
  112. package/dist/src/dashboard/integrations/queue_inspector.d.ts +3 -3
  113. package/dist/src/dashboard/integrations/queue_inspector.js +13 -10
  114. package/dist/src/dashboard/jobs_handlers.d.ts +14 -0
  115. package/dist/src/dashboard/jobs_handlers.js +61 -0
  116. package/dist/src/dashboard/knex_factory.d.ts +18 -0
  117. package/dist/src/dashboard/knex_factory.js +91 -0
  118. package/dist/src/dashboard/migrator.js +30 -159
  119. package/dist/src/dashboard/migrator_tables.d.ts +19 -0
  120. package/dist/src/dashboard/migrator_tables.js +153 -0
  121. package/dist/src/dashboard/overview_queries.d.ts +66 -0
  122. package/dist/src/dashboard/overview_queries.js +155 -0
  123. package/dist/src/dashboard/overview_query_runners.d.ts +25 -0
  124. package/dist/src/dashboard/overview_query_runners.js +84 -0
  125. package/dist/src/dashboard/overview_store_queries.d.ts +40 -0
  126. package/dist/src/dashboard/overview_store_queries.js +69 -0
  127. package/dist/src/dashboard/paginate_helper.d.ts +12 -0
  128. package/dist/src/dashboard/paginate_helper.js +33 -0
  129. package/dist/src/dashboard/query_explain_handler.d.ts +10 -0
  130. package/dist/src/dashboard/query_explain_handler.js +80 -0
  131. package/dist/src/dashboard/read_queries.d.ts +32 -0
  132. package/dist/src/dashboard/read_queries.js +107 -0
  133. package/dist/src/dashboard/saved_filter_queries.d.ts +10 -0
  134. package/dist/src/dashboard/saved_filter_queries.js +24 -0
  135. package/dist/src/dashboard/storage_stats.d.ts +41 -0
  136. package/dist/src/dashboard/storage_stats.js +81 -0
  137. package/dist/src/dashboard/write_queue.d.ts +106 -0
  138. package/dist/src/dashboard/write_queue.js +225 -0
  139. package/dist/src/data/data_access.d.ts +2 -39
  140. package/dist/src/data/data_access.js +17 -193
  141. package/dist/src/data/data_access_helpers.d.ts +130 -0
  142. package/dist/src/data/data_access_helpers.js +212 -0
  143. package/dist/src/debug/debug_store.js +37 -32
  144. package/dist/src/debug/email_collector.d.ts +1 -10
  145. package/dist/src/debug/email_collector.js +78 -81
  146. package/dist/src/debug/event_collector.d.ts +0 -9
  147. package/dist/src/debug/event_collector.js +79 -62
  148. package/dist/src/debug/query_collector.js +23 -19
  149. package/dist/src/debug/route_inspector.d.ts +1 -5
  150. package/dist/src/debug/route_inspector.js +50 -51
  151. package/dist/src/debug/trace_collector.d.ts +9 -1
  152. package/dist/src/debug/trace_collector.js +21 -15
  153. package/dist/src/debug/types.d.ts +1 -1
  154. package/dist/src/define_config.d.ts +0 -65
  155. package/dist/src/define_config.js +93 -333
  156. package/dist/src/edge/client/dashboard.js +2 -2
  157. package/dist/src/edge/client/debug-panel-deferred.js +1 -1
  158. package/dist/src/edge/client/stats-bar.js +1 -1
  159. package/dist/src/edge/client-vue/dashboard.js +5 -5
  160. package/dist/src/edge/client-vue/debug-panel-deferred.js +4 -4
  161. package/dist/src/edge/client-vue/stats-bar.js +3 -3
  162. package/dist/src/edge/plugin.d.ts +0 -16
  163. package/dist/src/edge/plugin.js +57 -64
  164. package/dist/src/engine/request_metrics.d.ts +1 -0
  165. package/dist/src/engine/request_metrics.js +32 -42
  166. package/dist/src/middleware/request_tracking_middleware.d.ts +2 -8
  167. package/dist/src/middleware/request_tracking_middleware.js +65 -93
  168. package/dist/src/provider/auth_middleware_detector.d.ts +16 -0
  169. package/dist/src/provider/auth_middleware_detector.js +97 -0
  170. package/dist/src/provider/boot_helpers.d.ts +20 -0
  171. package/dist/src/provider/boot_helpers.js +91 -0
  172. package/dist/src/provider/boot_initializer.d.ts +28 -0
  173. package/dist/src/provider/boot_initializer.js +35 -0
  174. package/dist/src/provider/dashboard_init.d.ts +30 -0
  175. package/dist/src/provider/dashboard_init.js +138 -0
  176. package/dist/src/provider/dashboard_setup.d.ts +25 -0
  177. package/dist/src/provider/dashboard_setup.js +78 -0
  178. package/dist/src/provider/diagnostics.d.ts +134 -0
  179. package/dist/src/provider/diagnostics.js +127 -0
  180. package/dist/src/provider/email_bridge.d.ts +43 -0
  181. package/dist/src/provider/email_bridge.js +80 -0
  182. package/dist/src/provider/email_helpers.d.ts +13 -0
  183. package/dist/src/provider/email_helpers.js +68 -0
  184. package/dist/src/provider/pino_hook.d.ts +17 -0
  185. package/dist/src/provider/pino_hook.js +35 -0
  186. package/dist/src/provider/provider_helpers_extra.d.ts +47 -0
  187. package/dist/src/provider/provider_helpers_extra.js +177 -0
  188. package/dist/src/provider/server_stats_provider.d.ts +39 -85
  189. package/dist/src/provider/server_stats_provider.js +132 -951
  190. package/dist/src/provider/shutdown_helpers.d.ts +43 -0
  191. package/dist/src/provider/shutdown_helpers.js +70 -0
  192. package/dist/src/provider/toolbar_setup.d.ts +57 -0
  193. package/dist/src/provider/toolbar_setup.js +141 -0
  194. package/dist/src/routes/dashboard_routes.d.ts +14 -0
  195. package/dist/src/routes/dashboard_routes.js +197 -0
  196. package/dist/src/routes/debug_routes.d.ts +14 -0
  197. package/dist/src/routes/debug_routes.js +101 -0
  198. package/dist/src/routes/register_routes.d.ts +0 -78
  199. package/dist/src/routes/register_routes.js +22 -352
  200. package/dist/src/routes/stats_routes.d.ts +5 -0
  201. package/dist/src/routes/stats_routes.js +14 -0
  202. package/dist/src/styles/components.css +163 -0
  203. package/dist/src/styles/dashboard.css +13 -105
  204. package/dist/src/styles/debug-panel.css +2 -53
  205. package/dist/src/styles/utilities.css +3 -1
  206. package/dist/src/types.d.ts +305 -14
  207. package/dist/vue/{CacheSection-oFAJL3mo.js → CacheSection-DT2Mwf_s.js} +1 -1
  208. package/dist/vue/{ConfigSection-BhfJ4KqL.js → ConfigSection-BwKwS9lh.js} +1 -1
  209. package/dist/vue/CustomPaneTab-Hr1IBHfz.js +172 -0
  210. package/dist/vue/{EmailsSection-BcNyhyHs.js → EmailsSection-B65g0FVS.js} +1 -1
  211. package/dist/vue/{EventsSection-r60Q5Lmu.js → EventsSection-CxqtVF-o.js} +1 -1
  212. package/dist/vue/{JobsSection-BHL-hkQw.js → JobsSection-rMIyMb-g.js} +1 -1
  213. package/dist/vue/{LogsSection-DRMGzJmg.js → LogsSection-DmmZVJ7D.js} +9 -3
  214. package/dist/vue/{LogsTab-Bg3o0Mm6.js → LogsTab-47zEK7jL.js} +4 -1
  215. package/dist/vue/{OverviewSection-CXh6Ja1B.js → OverviewSection-BMabyqw-.js} +49 -50
  216. package/dist/vue/{QueriesSection-IodIsCJ-.js → QueriesSection-BfDFwGqH.js} +44 -45
  217. package/dist/vue/{QueriesTab-C8_7oprC.js → QueriesTab-DuTG7cpC.js} +30 -31
  218. package/dist/vue/RelatedLogs.vue_vue_type_script_setup_true_lang-Py1iu9GU.js +77 -0
  219. package/dist/vue/{RequestsSection-BPuMdmMc.js → RequestsSection-CTu4jPZ_.js} +143 -147
  220. package/dist/vue/{RoutesSection-NKo3Rbq3.js → RoutesSection-zQZDedL7.js} +1 -1
  221. package/dist/vue/TimelineTab-DHfXsX7t.js +334 -0
  222. package/dist/vue/components/shared/RelatedLogs.vue.d.ts +1 -4
  223. package/dist/vue/composables/useDashboardData.d.ts +12 -23
  224. package/dist/vue/index-CM3yNVUR.js +1232 -0
  225. package/dist/vue/index.js +1 -1
  226. package/dist/vue/style.css +1 -1
  227. package/package.json +1 -1
  228. package/dist/react/CacheSection-UCMptWyn.js +0 -146
  229. package/dist/react/CacheTab-CA8LB1J5.js +0 -123
  230. package/dist/react/CustomPaneTab-Bxtv_8Rw.js +0 -104
  231. package/dist/react/EmailsSection-CM7stSyh.js +0 -262
  232. package/dist/react/EmailsTab-BDhEiomM.js +0 -153
  233. package/dist/react/EventsTab-CMfY98Rl.js +0 -63
  234. package/dist/react/InternalsSection-t7ihcWO-.js +0 -32
  235. package/dist/react/InternalsTab-Oij0A2fN.js +0 -30
  236. package/dist/react/JobsSection-DF3qEv9O.js +0 -187
  237. package/dist/react/JobsTab-BbrBWIOb.js +0 -141
  238. package/dist/react/LogsSection-DcFTZY7b.js +0 -227
  239. package/dist/react/LogsTab-CicucmVk.js +0 -103
  240. package/dist/react/QueriesSection-PswteoF9.js +0 -461
  241. package/dist/react/RelatedLogs-DFDOyUMr.js +0 -40
  242. package/dist/react/RequestsSection-Nag30rEA.js +0 -341
  243. package/dist/react/RoutesTab-DgVzd2PZ.js +0 -74
  244. package/dist/react/index-Cflz9Ebj.js +0 -1069
  245. package/dist/vue/CustomPaneTab-BJxT5Dp7.js +0 -172
  246. package/dist/vue/RelatedLogs.vue_vue_type_script_setup_true_lang-CB2_TzYW.js +0 -84
  247. package/dist/vue/TimelineTab-zj5Z5OdT.js +0 -338
  248. package/dist/vue/index-Dtgysd26.js +0 -1229
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  [![AdonisJS](https://img.shields.io/badge/AdonisJS-v6-5A45FF.svg)](https://adonisjs.com/)
8
8
  [![AdonisJS](https://img.shields.io/badge/AdonisJS-v7-5A45FF.svg)](https://adonisjs.com/)
9
9
 
10
- A Laravel Telescope-inspired dev toolbar and real-time server monitor for **AdonisJS v6**.
10
+ A Laravel Telescope-inspired dev toolbar and real-time server monitor for **AdonisJS v6 & v7**.
11
11
 
12
12
  Drop a single Edge tag into your layout and get a live stats bar showing CPU, memory, requests/sec, database pool, Redis, queues, and logs -- plus a full debug toolbar with SQL query inspection, event tracing, route listing, live log tailing, and custom panels.
13
13
 
@@ -178,7 +178,7 @@ All fields are optional. `defineConfig({})` works with zero configuration.
178
178
  | Option | Type | Default | Description |
179
179
  | -------------------- | ---------- | ------------------------------------------------- | ----------------------------------------------- |
180
180
  | `slowQueryThreshold` | `number` | `100` | Slow query threshold (ms) |
181
- | `tracing` | `boolean` | `false` | Enable per-request tracing with timeline |
181
+ | `tracing` | `boolean` | `true` | Enable per-request tracing with timeline |
182
182
  | `persist` | `boolean` | `false` | Persist debug data to disk across restarts |
183
183
  | `panes` | `DebugPane[]` | -- | Custom debug panel tabs |
184
184
  | `excludeFromTracing` | `string[]` | `['/admin/api/debug', '/admin/api/server-stats']` | URL prefixes to exclude from tracing/persistence |
@@ -231,7 +231,7 @@ The following field names still work but will show deprecation warnings at boot.
231
231
  | `maxEmails` | `number` | `100` | Max emails to buffer |
232
232
  | `slowQueryThresholdMs` | `number` | `100` | Slow query threshold (ms) |
233
233
  | `persistDebugData` | `boolean \| string` | `false` | Persist debug data to disk across restarts. `true` writes to `.adonisjs/server-stats/debug-data.json`, or pass a custom path. |
234
- | `tracing` | `boolean` | `false` | Enable per-request tracing with timeline visualization |
234
+ | `tracing` | `boolean` | `true` | Enable per-request tracing with timeline visualization |
235
235
  | `maxTraces` | `number` | `200` | Max request traces to buffer |
236
236
  | `dashboard` | `boolean` | `false` | Enable the full-page dashboard (requires `better-sqlite3`) |
237
237
  | `dashboardPath` | `string` | `'/__stats'` | URL path for the dashboard page |
@@ -381,16 +381,18 @@ Registered when `statsEndpoint` is a string (default: `/admin/api/server-stats`)
381
381
 
382
382
  Registered when `toolbar` is enabled. Base path configurable via `advanced.debugEndpoint` (default: `/admin/api/debug`).
383
383
 
384
- | Method | Path | Description |
385
- | ------ | --------------------- | ------------------------------- |
386
- | GET | `/queries` | SQL queries with summary stats |
387
- | GET | `/events` | Application events |
388
- | GET | `/routes` | Registered route table |
389
- | GET | `/logs` | Log file entries (last 256KB) |
390
- | GET | `/emails` | Captured emails (stripped HTML) |
391
- | GET | `/emails/:id/preview` | Email HTML preview |
392
- | GET | `/traces` | Request traces |
393
- | GET | `/traces/:id` | Trace detail with spans |
384
+ | Method | Path | Description |
385
+ | ------ | --------------------- | ---------------------------------------- |
386
+ | GET | `/queries` | SQL queries with summary stats |
387
+ | GET | `/events` | Application events |
388
+ | GET | `/routes` | Registered route table |
389
+ | GET | `/logs` | Paginated log entries (up to 200) |
390
+ | GET | `/emails` | Captured emails (stripped HTML) |
391
+ | GET | `/emails/:id/preview` | Email HTML preview |
392
+ | GET | `/traces` | Request traces with log correlation |
393
+ | GET | `/traces/:id` | Trace detail with spans and related logs |
394
+ | GET | `/config` | Debug store configuration |
395
+ | GET | `/diagnostics` | Provider diagnostics and status |
394
396
 
395
397
  ### Dashboard routes
396
398
 
@@ -415,6 +417,7 @@ Registered when `dashboard` is enabled. Base path configurable via `dashboard.pa
415
417
  | GET | `/api/traces/:id` | Trace detail with spans |
416
418
  | GET | `/api/cache` | Cache stats and key listing |
417
419
  | GET | `/api/cache/:key` | Cache key detail |
420
+ | DELETE | `/api/cache/:key` | Delete a cache key |
418
421
  | GET | `/api/jobs` | Job queue overview |
419
422
  | GET | `/api/jobs/:id` | Job detail |
420
423
  | POST | `/api/jobs/:id/retry` | Retry a failed job |
@@ -582,7 +585,7 @@ The React and Vue components share the same theme system as Edge. Dark/light pre
582
585
  - The dashboard page is large — lazy-loading helps but initial bundle may be significant
583
586
  - Some edge cases in custom pane rendering may not be fully covered yet
584
587
  - Error boundaries are minimal — a bad API response may cause a blank panel
585
- - Only tested with React 18+ and Vue 3.3+
588
+ - Only tested with React 18/19 and Vue 3.3+
586
589
 
587
590
  Found a bug? Have feedback? [Open an issue](https://github.com/simulieren/adonisjs-server-stats/issues) — it helps a lot.
588
591
 
@@ -714,6 +717,12 @@ const result = await trace('organization.fetchMembers', async () => {
714
717
 
715
718
  If tracing is disabled or no request is active, `trace()` executes the function directly with no overhead.
716
719
 
720
+ #### Related Logs
721
+
722
+ When viewing a trace detail (either in the debug panel Timeline tab or the dashboard), related log entries are automatically correlated using the HTTP request ID (`ctx.request.id()`). Any logs emitted during the request appear in a "Related Logs" section below the waterfall chart.
723
+
724
+ This works with both SQLite persistence (joins on `http_request_id`) and in-memory mode (scans the log file for matching `request_id` entries). No configuration needed — if your app uses AdonisJS request IDs, correlation happens automatically.
725
+
717
726
  ### Full-Page Dashboard
718
727
 
719
728
  The dashboard is a dedicated page that provides historical data, charts, query analysis, and integration inspectors -- all persisted to a local SQLite database. It's like having Laravel Telescope built into your dev toolbar.
@@ -20,6 +20,14 @@ export interface FormattedValue {
20
20
  * Redacted objects have the shape `{ __redacted: true, display: string, value: string }`.
21
21
  */
22
22
  export declare function isRedactedValue(val: ConfigValue): val is RedactedValue;
23
+ /**
24
+ * Check whether a config value is a plain config object (not null, not an
25
+ * array, not a redacted value). This consolidates the repeated
26
+ * null/typeof/array/redacted checks into a single reusable guard.
27
+ */
28
+ export declare function isPlainConfigObject(val: ConfigValue): val is {
29
+ [key: string]: ConfigValue;
30
+ };
23
31
  /**
24
32
  * Recursively flatten a nested config object into a list of dot-path entries.
25
33
  *
@@ -8,3 +8,7 @@ export declare const DEBUG_REFRESH_MS = 3000;
8
8
  export declare const SLOW_DURATION_MS = 100;
9
9
  /** Duration (ms) above which a query/request is considered very slow. */
10
10
  export declare const VERY_SLOW_DURATION_MS = 500;
11
+ /** Max data points in the sparkline history buffer per metric. */
12
+ export declare const MAX_HISTORY = 60;
13
+ /** Milliseconds after last success before connection is considered stale. */
14
+ export declare const STALE_MS = 10000;
@@ -153,6 +153,22 @@ export declare class DashboardDataController {
153
153
  * Get the underlying `ApiClient` instance.
154
154
  */
155
155
  getClient(): ApiClient;
156
+ /** Whether this fetch call should be skipped entirely. */
157
+ private shouldSkipFetch;
158
+ /** Prepare abort controller, increment fetch ID, set loading state. */
159
+ private prepareFetch;
160
+ /** Execute the actual API fetch for the current section. */
161
+ private executeFetch;
162
+ /** Check if a response is stale (fetch ID mismatch or controller stopped). */
163
+ private isStaleResponse;
164
+ /** Check if an error should be silently ignored (abort or stale). */
165
+ private shouldIgnoreError;
166
+ /** Build query string from current controller state. */
167
+ private buildCurrentQueryString;
168
+ /** Apply a successful fetch result to the callbacks. */
169
+ private applyFetchResult;
170
+ /** Handle a fetch error (unauthorized, network, etc.). */
171
+ private handleFetchError;
156
172
  private startRefreshTimer;
157
173
  private stopRefreshTimer;
158
174
  }
@@ -0,0 +1,12 @@
1
+ import { PaginatedResponse } from './types.js';
2
+ /**
3
+ * Check if a result is a paginated response (has data + meta).
4
+ */
5
+ export declare function isPaginatedResult(result: unknown): result is {
6
+ data: unknown;
7
+ meta: PaginatedResponse<unknown>['meta'];
8
+ };
9
+ /**
10
+ * Check if an error is an AbortError (request was cancelled).
11
+ */
12
+ export declare function isAbortedRequest(err: unknown, signal: AbortSignal): boolean;
@@ -86,4 +86,8 @@ export declare class DebugDataController<T = unknown> {
86
86
  */
87
87
  clearCache(): void;
88
88
  private fetchData;
89
+ /** Serve cached data if available. Returns true if cache hit. */
90
+ private serveFromCache;
91
+ /** Handle errors from fetchData. */
92
+ private handleFetchError;
89
93
  }
@@ -0,0 +1,25 @@
1
+ import { DevToolbarOptions, ServerStatsConfig, ToolbarConfig } from '../types.js';
2
+ /**
3
+ * Return the first defined (non-undefined) value from the arguments.
4
+ * Falls back to the last argument (the default).
5
+ */
6
+ export declare function firstDefined<T>(...args: Array<T | undefined>): T;
7
+ /**
8
+ * Apply a toolbar boolean or ToolbarConfig onto the result DevToolbarOptions.
9
+ */
10
+ export declare function applyToolbarSetting(toolbar: boolean | ToolbarConfig, result: DevToolbarOptions): void;
11
+ /**
12
+ * Apply a dashboard boolean or DashboardConfig onto the result DevToolbarOptions.
13
+ */
14
+ export declare function applyDashboardSetting(dashboard: boolean | {
15
+ path?: string;
16
+ retentionDays?: number;
17
+ }, result: DevToolbarOptions): void;
18
+ /**
19
+ * Apply advanced config fields onto the result DevToolbarOptions.
20
+ */
21
+ export declare function applyAdvancedConfig(advanced: NonNullable<ServerStatsConfig['advanced']>, result: DevToolbarOptions): void;
22
+ /**
23
+ * Resolve transport from new and deprecated config options.
24
+ */
25
+ export declare function resolveTransport(config: ServerStatsConfig): 'transmit' | 'none';
@@ -0,0 +1,36 @@
1
+ import { FeatureFlags, FeatureConfig } from './types.js';
2
+ /**
3
+ * Mapping from FeatureConfig keys to their default value.
4
+ * Used to data-drive the flattenFlags function.
5
+ */
6
+ export declare const FEATURE_KEYS: Array<keyof Omit<FeatureConfig, 'customPanes'>>;
7
+ /**
8
+ * Flatten a FeatureFlags response to a FeatureConfig using the
9
+ * data-driven FEATURE_KEYS list.
10
+ */
11
+ export declare function flattenFlagsFromKeys(flags: FeatureFlags): FeatureConfig;
12
+ /**
13
+ * Rules for mapping feature flags to metric groups in getVisibleMetricGroups.
14
+ */
15
+ export interface FlagGroupRule {
16
+ flag: string;
17
+ group: string;
18
+ }
19
+ /**
20
+ * Which flags enable which metric groups.
21
+ * Some groups can be triggered by multiple flags (e.g. memory by process or system).
22
+ */
23
+ export declare const FLAG_TO_GROUP: FlagGroupRule[];
24
+ /**
25
+ * Rules for detecting metric groups from actual stats data.
26
+ * Each rule maps stat field names to a group name.
27
+ */
28
+ export interface StatsGroupRule {
29
+ group: string;
30
+ fields: string[];
31
+ }
32
+ export declare const STATS_GROUP_RULES: StatsGroupRule[];
33
+ /**
34
+ * Check if a value is a number (including 0).
35
+ */
36
+ export declare function hasStatValue(v: unknown): v is number;
@@ -0,0 +1,64 @@
1
+ type Row = Record<string, unknown>;
2
+ /**
3
+ * Resolve a field value from a row, trying multiple candidate key names.
4
+ * Returns the first truthy value found, or the fallback.
5
+ */
6
+ export declare function resolveField<T>(row: Row, ...keys: string[]): T | undefined;
7
+ /**
8
+ * Resolve a timestamp field. Tries `createdAt`, `created_at`, `timestamp`.
9
+ */
10
+ export declare function resolveTimestamp(row: Row): string | number | undefined;
11
+ /**
12
+ * Resolve a timestamp for jobs. Tries `timestamp`, `createdAt`, `processedAt`, `created_at`.
13
+ */
14
+ export declare function resolveJobTimestamp(row: Row): string | number | undefined;
15
+ /**
16
+ * Resolve HTTP status code. Tries `statusCode`, `status_code`.
17
+ */
18
+ export declare function resolveStatusCode(row: Row): number | undefined;
19
+ /**
20
+ * Resolve request duration. Tries `total_duration`, `totalDuration`, `duration`.
21
+ */
22
+ export declare function resolveDuration(row: Row): number;
23
+ /**
24
+ * Resolve span count. Tries `span_count`, `spanCount`.
25
+ */
26
+ export declare function resolveSpanCount(row: Row): number;
27
+ /**
28
+ * Resolve warning count. Tries `warning_count`, `warningCount`.
29
+ */
30
+ export declare function resolveWarningCount(row: Row): number;
31
+ /**
32
+ * Resolve email "from" address. Tries `from_addr`, `from`.
33
+ */
34
+ export declare function resolveFromAddr(row: Row): string;
35
+ /**
36
+ * Resolve email "to" address. Tries `to_addr`, `to`.
37
+ */
38
+ export declare function resolveToAddr(row: Row): string;
39
+ /**
40
+ * Resolve email CC address. Tries `cc`, `cc_addr`.
41
+ */
42
+ export declare function resolveCcAddr(row: Row): string;
43
+ /**
44
+ * Resolve attachment count. Tries `attachment_count`, `attachmentCount`.
45
+ */
46
+ export declare function resolveAttachmentCount(row: Row): number;
47
+ /**
48
+ * Resolve event name. Tries `event_name`, `eventName`, `event`.
49
+ */
50
+ export declare function resolveEventName(row: Row): string;
51
+ /**
52
+ * Resolve SQL method. Tries `method`, `sql_method`.
53
+ */
54
+ export declare function resolveSqlMethod(row: Row): string;
55
+ /**
56
+ * Resolve normalized SQL text. Tries `sqlNormalized`, `normalizedSql`, `sql_normalized`, `sql`.
57
+ */
58
+ export declare function resolveNormalizedSql(row: Row): string;
59
+ /**
60
+ * Resolve overview metric with snake_case fallback. Returns the camelCase
61
+ * value if present, otherwise converts the snake_case raw value to a number.
62
+ */
63
+ export declare function resolveMetric(metrics: Row, camelKey: string, snakeKey: string): number;
64
+ export {};
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Create a compact preview of a string value.
3
+ * Truncates at 40 characters and wraps in quotes.
4
+ */
5
+ export declare function previewString(value: string): string;
6
+ /**
7
+ * Create a compact preview of an array value.
8
+ * Shows first 3 items with a summary for larger arrays.
9
+ *
10
+ * @param value - The array to preview.
11
+ * @param maxLen - Maximum preview string length before falling back to a summary.
12
+ * @param recurse - Function to recursively preview nested values.
13
+ */
14
+ export declare function previewArray(value: unknown[], maxLen: number, recurse: (v: unknown, max: number) => string): string;
15
+ /**
16
+ * Create a compact preview of a plain object value.
17
+ * Shows first 4 key-value pairs with a summary for larger objects.
18
+ *
19
+ * @param value - The object to preview.
20
+ * @param maxLen - Maximum preview string length before falling back to keys-only.
21
+ * @param recurse - Function to recursively preview nested values.
22
+ */
23
+ export declare function previewObject(value: Record<string, unknown>, maxLen: number, recurse: (v: unknown, max: number) => string): string;
@@ -144,6 +144,21 @@ export declare function statusColor(statusCode: number): ThresholdColor;
144
144
  * @param ms - Duration in milliseconds.
145
145
  */
146
146
  export declare function durationSeverity(ms: number): 'normal' | 'slow' | 'very-slow';
147
+ /**
148
+ * Return a CSS severity class for a duration value.
149
+ *
150
+ * Combines {@link durationSeverity} with a CSS-prefix to produce the
151
+ * appropriate class name. Returns an empty string for normal durations.
152
+ *
153
+ * Examples (with default prefix `'ss-dash'`):
154
+ * - `> 500ms` -> `'ss-dash-very-slow'`
155
+ * - `> 100ms` -> `'ss-dash-slow'`
156
+ * - Otherwise -> `''`
157
+ *
158
+ * @param ms - Duration in milliseconds.
159
+ * @param prefix - CSS class prefix (default `'ss-dash'`).
160
+ */
161
+ export declare function durationClassName(ms: number, prefix?: string): string;
147
162
  /**
148
163
  * Truncate a request ID to a short preview.
149
164
  *
@@ -6,7 +6,7 @@ export type { ServerStats, MetricValue, ServerStatsConfig, ResolvedServerStatsCo
6
6
  export { getTheme, setTheme, toggleTheme, onThemeChange } from './theme.js';
7
7
  export { generateSparklinePoints, generateSparklinePath, generateGradientId, computeStats, buildSparklineData, } from './sparkline.js';
8
8
  export type { SparklineStats, SparklineData } from './sparkline.js';
9
- export { formatUptime, formatBytes, formatMb, formatCount, formatDuration, formatTime, timeAgo, formatStatNum, getThresholdColor, getThresholdColorInverse, getRatioColor, compactPreview, statusColor, durationSeverity, shortReqId, THRESHOLD_CSS_CLASS, THRESHOLD_HEX_FALLBACK, THRESHOLD_CSS_VAR, formatTtl, formatCacheSize, } from './formatters.js';
9
+ export { formatUptime, formatBytes, formatMb, formatCount, formatDuration, formatTime, timeAgo, formatStatNum, getThresholdColor, getThresholdColorInverse, getRatioColor, compactPreview, statusColor, durationSeverity, durationClassName, shortReqId, THRESHOLD_CSS_CLASS, THRESHOLD_HEX_FALLBACK, THRESHOLD_CSS_VAR, formatTtl, formatCacheSize, } from './formatters.js';
10
10
  export { DEFAULT_PER_PAGE, buildQueryString, buildQueryParams, computePagination, parsePaginatedResponse, createPaginationState, createFilterState, createSortState, getPageNumbers, } from './pagination.js';
11
11
  export type { RawPaginatedResponse } from './pagination.js';
12
12
  export { fetchFeatures, detectFeatures, DEFAULT_FEATURES, getVisibleMetricGroups, detectMetricGroupsFromStats, } from './feature-detect.js';