Reference

Configuration

The options PeekInside.attach() takes, and the environment variables it reads.

PeekInside.attach(app, {
  project: 'orders-api',
  maxBodySize: 128 * 1024,
  ignorePaths: ['/health', /^\/metrics/]
});

Options#

Option Default Description
maxBodySize 65536 Bytes captured per request or response body; larger bodies are truncated and marked as such
ignorePaths [] Paths never recorded: string prefixes, regular expressions or (pathname) => boolean
project package.json name Project name in the local dashboard
local on in development Turn the local dashboard on or off
apiKey PEEKINSIDE_API_KEY PeekInside Cloud API key; enables cloud mode
environment PEEKINSIDE_ENV, then NODE_ENV Label shown with each request, such as staging
captureExceptions true Record exceptions automatically (see Exceptions); report() works either way
sourceContext true Include the source lines around your own code in exception records
timeline true Record each request's timeline (see Timeline and queries)
captureQueries true Database queries: pg, mysql2, MongoDB, Prisma
captureOutgoing true Outgoing node:http/https calls and fetch
captureLogs true Console lines
queryParams true Keep the (masked) values sent with queries
slowQueryMs 100 Queries this slow or slower are flagged
nPlusOneThreshold 5 A statement run this many times in one request is flagged as an N+1

Common browser and dev-server noise (/favicon.ico, /.well-known/, /__webpack_hmr, /sockjs-node/, /_next/static/, /static/) is never recorded.

Environment variables#

Variable Description
PEEKINSIDE_API_KEY Cloud API key (cloud mode)
PEEKINSIDE_ENV Environment label
PEEKINSIDE_PROJECT Project name in the local dashboard
PEEKINSIDE_LOCAL 1 or 0 to force local mode on or off
PEEKINSIDE_HUB_PORT Port of the local dashboard (default 7335)
PEEKINSIDE_HOME Folder for local data (default ~/.peekinside)
PEEKINSIDE_MAX_REQUESTS Requests the local dashboard keeps per project (default 1000)
PEEKINSIDE_MAX_EXCEPTIONS Exceptions the local dashboard keeps per project (default 500)
PEEKINSIDE_URL Base URL of the PeekInside site (default https://peekinside.dev), for developing the dashboard itself