Registry / web-framework / adonisjs-server-stats

adonisjs-server-stats

JSON →
library1.12.3jsnpmunverified

Current stable version 1.12.3. Real-time server monitoring and debug toolbar for AdonisJS v6/v7 applications, inspired by Laravel Telescope. Provides live CPU, memory, requests/sec, database pool, Redis, queue, and log stats via a single Edge component (`@serverStats()`). Includes a full debug toolbar with SQL query inspection, event tracing, route listing, log tailing, and custom panels. Ships TypeScript types and integrates with Lucid ORM, Redis, BullMQ, and Edge templates. Zero frontend dependencies; also offers alpha React/Vue components for Inertia.js. Peer dependencies span multiple major versions (e.g., @adonisjs/core ^6.0.0 || ^7.0.0).

npm install adonisjs-server-stats
INSTALL
IMPORT
SIG · ADONISJS-SERVER-ST
A
adonisjs-server-stats
web-frameworkjavascriptv1.12.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

configure
import { configure } from 'adonisjs-server-stats/configure'
import { configure } from 'adonisjs-server-stats'
The configure function is exported from the configure subpath. Direct import from root won't work.
serverStatsMiddleware
import serverStatsMiddleware from 'adonisjs-server-stats/edge'
import { serverStatsMiddleware } from 'adonisjs-server-stats'
The middleware is registered as an Edge tag; import the default export from the 'edge' subpath.
ServerStatsCollectorOptions
import type { ServerStatsCollectorOptions } from 'adonisjs-server-stats/types'
import { ServerStatsCollectorOptions } from 'adonisjs-server-stats'
Type imports should use the 'types' subpath for proper TypeScript support.

Basic setup: install via Ace, configure in config file, and render toolbar in Edge layout.

// Install: node ace add adonisjs-server-stats // Configure in config/server-stats.ts: import { defineConfig } from 'adonisjs-server-stats' export default defineConfig({ enabled: true, authorization: ['127.0.0.1'], collect: { requests: true, database: true, redis: true, queue: true, logs: true, }, queries: { slowQueryThreshold: 100, }, }) // In layout edge template: @serverStats() // Then visit your app; toolbar appears for localhost requests.
Debug
Known issues
breakingv1.0.0 changed the import path for configure to subpath 'adonisjs-server-stats/configure' instead of root.
fix
Use 'adonisjs-server-stats/configure' for configure imports.
affects: >=1.0.0 <1.0.0
deprecatedUse of `@serverStats({ collector: 'sqlite' })` option is deprecated; use database config instead.
fix
Remove the collector option and rely on the database config block.
affects: >=0.9.0
gotchaThe toolbar only shows for requests with IP in the authorization array (defaults to 127.0.0.1). In production, you must set AUTHORIZED_IPS env or configure authorization.
fix
Set AUTHORIZED_IPS=your-ip in .env or add to config/server-stats.ts authorization array.
affects: >=0.1.0
gotchaSlow query logging requires a running database connection; if no connection is established, the queries panel may appear empty.
fix
Ensure your database driver (e.g., better-sqlite3) is installed and configured in config/database.ts.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'adonisjs-server-stats' or its corresponding type declarations.
Missing peer dependencies or incorrect installation.
fix
Run `node ace add adonisjs-server-stats` to install peer deps automatically.
Edge tag not rendered: `@serverStats()` is unknown.
Middleware not registered or package not configured.
fix
Register the middleware in start/kernel.ts: import serverStatsMiddleware from 'adonisjs-server-stats/edge'; and add it to server middleware stack.
TypeError: configure is not a function
Incorrect import path for configure function.
fix
Change import to `import { configure } from 'adonisjs-server-stats/configure'`.
Upgrade
Version history
1.12.3latest on npm
Audit
Dependencies
@adonisjs/corerequiredCore AdonisJS framework peer dependency
@adonisjs/lucidoptionalFor database query monitoring
@adonisjs/redisoptionalFor Redis stats
better-sqlite3optionalFor SQLite database support
bullmqoptionalFor queue monitoring
edge.jsrequiredFor server-side rendering the toolbar component
Agent activity
51 hits · last 30 days
node
40
OpenAI (training)
3
Resources
adonisjs-server-stats — npm install adonisjs-server-stats · libregistry