Repository navigation
v1.2.0 - Request Tracing & Timeline
Per-Request Tracing with Timeline Visualization
New feature: trace every HTTP request with a waterfall timeline showing exactly what happened — DB queries, events, mail, and custom operations — in what order and how long each took.
New Features
- Timeline tab in the debug panel — shows a list of recent requests with method, URL, status, duration, span count, and warnings
- Waterfall chart — click any request to see a visual timeline of all operations, color-coded by category
- Automatic span capture — DB queries (
db:query) andconsole.warncalls are automatically captured within the request context - Custom spans — wrap any async code with
trace()to add it to the timeline:import { trace } from 'adonisjs-server-stats' const result = await trace('fetchMembers', async () => { return OrganizationService.getMembers(orgId) })
- Persistence — traces survive server restarts when
persistDebugDatais enabled
Configuration
export default defineConfig({
devToolbar: {
enabled: true,
tracing: true, // Enable request tracing
maxTraces: 200, // Ring buffer size (default: 200)
},
})Span Categories
| Category | Color | Auto-captured |
|---|---|---|
| DB | Purple | ✅ db:query events |
| Request | Blue | ✅ Full request lifecycle |
| Green | — | |
| Event | Amber | — |
| View | Cyan | — |
| Custom | Gray | Via trace() helper |
New Exports
trace()— function to create custom spansTraceSpan— type for individual spansTraceRecord— type for complete request traces
API Endpoints
GET /admin/api/debug/traces— list recent traces (summary)GET /admin/api/debug/traces/:id— full trace with spans