Skip to content
Open source · Node.js observability

See everything your Node.js app is doing.

Lens is a framework-agnostic monitoring and debugging toolkit. Capture requests, database queries, cache, exceptions, mail, and jobs in one self-hosted dashboard.

npm install @lensjs/express @lensjs/watchers
52 @lensjs/core v3.1.0MIT licensed

Works with Express · Fastify · NestJS · Hono · Next.js · AdonisJS

server.ts
import { lens } from "@lensjs/express";
import express from "express";
 
const app = express();
 
await lens({
  app,
  requestWatcherEnabled: true,
  queryWatcher: {
    enabled: true,
    handler: createPrismaHandler({ provider: "postgresql" }),
  },
});
 
// Dashboard is live at /lens
app.listen(3000);
Capabilities

One toolkit for the whole request lifecycle

Lens captures the signals that matter and correlates them to a single request, so you can trace cause and effect without stitching tools together.

Requests

Every request with headers, body, response, status, duration, and the resolved user — redacted by default.

Database queries

Prisma, Kysely, Sequelize, MikroORM, Drizzle and Mongoose, correlated to the request that issued them.

Cache

Track hits, misses, writes and evictions across your caching layer with precise timing.

Exceptions

Automatic capture with stack traces, fingerprint grouping, and Slack / Discord / webhook alerts.

Mail

Audit outgoing email with rich MIME previews, iCalendar events, and attachments.

Jobs & queues

Watch BullMQ and Agenda jobs move through active, completed, and failed in real time.

Dashboard

A dashboard you'll actually enjoy using

Every signal, organized and correlated to the request that produced it — served right from your own app, with search, filters, and a live tail.

localhost:3000/lens
Lens dashboard — Requests viewLens dashboard — Queries viewLens dashboard — Exceptions viewLens dashboard — Overview view
Adapters

Plugs into your framework

A thin adapter translates your framework into Lens. Same engine, same dashboard, same data model — everywhere.

Quick start

From zero to insight in three steps

  1. 1

    Install the adapter

    Add the adapter for your framework plus the watchers package.

  2. 2

    Wire it up

    Call lens() with your app instance and enable the watchers you want.

  3. 3

    Open the dashboard

    Visit /lens in your browser and watch requests stream in live.

npm install @lensjs/express @lensjs/watchers
import { lens } from "@lensjs/express";
import express from "express";

const app = express();

await lens({ app });

app.listen(3000);
Read the full guide
Packages

A focused, modular ecosystem

Install only what you need. Every package is published under the @lensjs/* scope with a stable, tree-shakable API.

The framework-agnostic engine: capture, context, store, API, and the bundled dashboard.

Express adapter — the reference integration for Lens.

Fastify adapter with request-lifecycle context and sampling.

NestJS adapter over Express or Fastify.

Hono adapter for edge-ready Node runtimes.

Next.js (App Router) adapter.

AdonisJS adapter following Adonis package conventions.

ORM & mailer handlers: Prisma, Kysely, Sequelize, MikroORM, Nodemailer and more.

Export captured signals as OpenTelemetry (OTLP) spans.

Model Context Protocol server so AI agents can read captured errors & requests.

Shared UTC producers and UI date presenters.