{"id":24889,"library":"adonisjs-server-stats","title":"AdonisJS Server Stats","description":"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).","status":"active","version":"1.12.3","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","adonisjs","debug","devtools","metrics","monitoring","server-stats","typescript"],"install":[{"cmd":"npm install adonisjs-server-stats","lang":"bash","label":"npm"},{"cmd":"yarn add adonisjs-server-stats","lang":"bash","label":"yarn"},{"cmd":"pnpm add adonisjs-server-stats","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core AdonisJS framework peer dependency","package":"@adonisjs/core","optional":false},{"reason":"For database query monitoring","package":"@adonisjs/lucid","optional":true},{"reason":"For Redis stats","package":"@adonisjs/redis","optional":true},{"reason":"For SQLite database support","package":"better-sqlite3","optional":true},{"reason":"For queue monitoring","package":"bullmq","optional":true},{"reason":"For server-side rendering the toolbar component","package":"edge.js","optional":false}],"imports":[{"note":"The configure function is exported from the configure subpath. Direct import from root won't work.","wrong":"import { configure } from 'adonisjs-server-stats'","symbol":"configure","correct":"import { configure } from 'adonisjs-server-stats/configure'"},{"note":"The middleware is registered as an Edge tag; import the default export from the 'edge' subpath.","wrong":"import { serverStatsMiddleware } from 'adonisjs-server-stats'","symbol":"serverStatsMiddleware","correct":"import serverStatsMiddleware from 'adonisjs-server-stats/edge'"},{"note":"Type imports should use the 'types' subpath for proper TypeScript support.","wrong":"import { ServerStatsCollectorOptions } from 'adonisjs-server-stats'","symbol":"ServerStatsCollectorOptions","correct":"import type { ServerStatsCollectorOptions } from 'adonisjs-server-stats/types'"}],"quickstart":{"code":"// Install: node ace add adonisjs-server-stats\n// Configure in config/server-stats.ts:\nimport { defineConfig } from 'adonisjs-server-stats'\nexport default defineConfig({\n  enabled: true,\n  authorization: ['127.0.0.1'],\n  collect: {\n    requests: true,\n    database: true,\n    redis: true,\n    queue: true,\n    logs: true,\n  },\n  queries: {\n    slowQueryThreshold: 100,\n  },\n})\n// In layout edge template:\n@serverStats()\n// Then visit your app; toolbar appears for localhost requests.","lang":"typescript","description":"Basic setup: install via Ace, configure in config file, and render toolbar in Edge layout."},"warnings":[{"fix":"Use 'adonisjs-server-stats/configure' for configure imports.","message":"v1.0.0 changed the import path for configure to subpath 'adonisjs-server-stats/configure' instead of root.","severity":"breaking","affected_versions":">=1.0.0 <1.0.0"},{"fix":"Remove the collector option and rely on the database config block.","message":"Use of `@serverStats({ collector: 'sqlite' })` option is deprecated; use database config instead.","severity":"deprecated","affected_versions":">=0.9.0"},{"fix":"Set AUTHORIZED_IPS=your-ip in .env or add to config/server-stats.ts authorization array.","message":"The 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.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Ensure your database driver (e.g., better-sqlite3) is installed and configured in config/database.ts.","message":"Slow query logging requires a running database connection; if no connection is established, the queries panel may appear empty.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `node ace add adonisjs-server-stats` to install peer deps automatically.","cause":"Missing peer dependencies or incorrect installation.","error":"Cannot find module 'adonisjs-server-stats' or its corresponding type declarations."},{"fix":"Register the middleware in start/kernel.ts: import serverStatsMiddleware from 'adonisjs-server-stats/edge'; and add it to server middleware stack.","cause":"Middleware not registered or package not configured.","error":"Edge tag not rendered: `@serverStats()` is unknown."},{"fix":"Change import to `import { configure } from 'adonisjs-server-stats/configure'`.","cause":"Incorrect import path for configure function.","error":"TypeError: configure is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}