Skip to content

Debug Dashboard

The DebugDashboard provides a visual interface to inspect your running application. It allows you to:

  • View real-time metrics (requests/sec, errors, latency).
  • Visualize the middleware graph and request flow.
  • Inspect the component registry (controllers, routes).
  • View middleware execution logs if enableMiddlewareTracking is on.
  • Inspect and replay failed requests captured by FailedRequestRecorder.

Debug Dashboard Overview

import { DebugDashboard } from 'shokupan';
// Mount the dashboard at a path of your choice
app.mount('/debug', new DebugDashboard({
retentionMs: 7200000 // Keep logs for 2 hours
}));
OptionTypeDescription
retentionMsnumberHow long to keep in-memory metrics and logs (ms).
getRequestHeaders() => Record<string, string>Hook to provide custom headers (e.g. auth tokens) when replaying requests from the dashboard.

Visualizes the structure of your application, showing how routers, controllers, and middleware are connected.

Middleware Graph

Inspect all registered routes and controllers in a flat or hierarchical view.

Component Registry

Analyze incoming requests, their duration, and the time spent in each middleware.

Requests View

Lists requests that resulted in errors. You can click on a failure to see details and replay it.

Replaying a request sends the identical request payload to the server again, which is useful for debugging idempotent operations or testing fixes.