@strav/devtools
Debug inspector and performance monitor for the Strav framework. Request inspector, SQL query profiler, exception tracker, log viewer, and APM dashboard.
Install
bun add -d @strav/devtools
bun strav install devtools
Requires @strav/core as a peer dependency.
Setup
import { DevtoolsProvider } from '@strav/devtools'
app.use(new DevtoolsProvider())
The provider auto-registers the middleware and serves the dashboard at /_devtools.
Collectors
Collectors capture data from your application:
- RequestCollector — HTTP requests and responses
- QueryCollector — SQL queries with timing
- ExceptionCollector — Unhandled exceptions
- LogCollector — Log entries
- JobCollector — Queue job execution
Recorders
Recorders aggregate data for performance monitoring:
- SlowRequestsRecorder — Tracks slow HTTP requests
- SlowQueriesRecorder — Tracks slow SQL queries
Usage
import { devtools } from '@strav/devtools'
const entries = await devtools.entries({ type: 'request', limit: 50 })
const aggregates = await devtools.aggregates('slow-requests', '1h')
CLI
bun strav devtools:setup
bun strav devtools:prune
Documentation
See the full Devtools guide.
License
MIT