Introduction
An open-source NestJS profiler inspired by Symfony's Web Profiler - inspect SQL, HTTP, GraphQL, cache, auth and custom spans to debug and optimize performance.
@eleven-labs/nest-profiler is a Symfony Web Profiler-inspired toolkit for NestJS applications. Every profiled execution - an HTTP request, a GraphQL operation, or a CLI command - receives a unique token, and a rich panel UI at /_profiler lets you inspect request data, logs, exceptions, performance spans, database queries, and more, in real time.
The ecosystem is built around an extensible collector architecture: the core package provides the profiler engine, storage, and UI, while optional sub-packages each add a dedicated panel as a self-contained NestJS module.
Getting started
Install the core package and open the profiler UI in under 5 minutes.
Packages
Core profiler and all optional collector packages: TypeORM, MikroORM, Mongoose, HTTP, Cache, Commander, Auth, Config, Routes, Validator, GraphQL, RabbitMQ, event emitter.
Example application
Full NestJS app organized by module - one module per collector package.
Tutorials
Step-by-step guides for every collector and storage backend.
API Reference
Auto-generated type documentation for all packages.
Packages
| Package | Panel | What it captures |
|---|---|---|
@eleven-labs/nest-profiler | Core | Request, response, logs, exceptions, performance spans |
@eleven-labs/nest-profiler-typeorm | Database | SQL queries with type, duration, slow-query highlighting |
@eleven-labs/nest-profiler-mikro-orm | Database | SQL queries with type, duration, slow-query highlighting (MikroORM) |
@eleven-labs/nest-profiler-mongoose | MongoDB | Mongoose queries & aggregations: collection, operation, duration, result count |
@eleven-labs/nest-profiler-http | HTTP Client | Outgoing calls from any client (axios, fetch, your own): method, URL, status, duration, phase timings |
@eleven-labs/nest-profiler-cache | Cache | GET_HIT / GET_MISS / SET / DEL with hit-ratio badge |
@eleven-labs/nest-profiler-commander | Command | nest-commander CLI runs: name, arguments, options, outcome |
@eleven-labs/nest-profiler-auth | Security | request.user, JWT claims, roles - sensitive fields masked |
@eleven-labs/nest-profiler-config | Config | ConfigService snapshot with secret masking |
@eleven-labs/nest-profiler-routes | Discover | The routing table of each transport, discovered at startup: route, handler, guards, inputs |
@eleven-labs/nest-profiler-validator | Validator | DTO validation results - property violations with constraint names |
@eleven-labs/nest-profiler-graphql | GraphQL | GraphQL queries/mutations: operation type, name, query, variables |
@eleven-labs/nest-profiler-rabbitmq | RabbitMQ | Consumed @RabbitSubscribe messages, and published ones: exchange, routing key, payload |
@eleven-labs/nest-profiler-event-emitter | Events | @nestjs/event-emitter emissions and each @OnEvent handler execution |
Key features
- Floating toolbar - injected into HTML responses with per-collector badges (query count, hit ratio, violation count, …)
- Unified execution trace - the entrypoint, framework phases, queries, outgoing calls and your own
tracer.span()on one waterfall, nested by causality - Performance tags - a rule engine flags slow queries, N+1, chatty endpoints, large payloads and zero-row writes, and makes them filterable on the list page
- Extensible collectors - implement
IProfilerCollectorto add your own panel with a custom EJS template and toolbar badge - Three storage backends - in-memory LRU (default), file-based persistence that survives restarts, or a first-party SQLite adapter that filters and paginates in the database
- Request sampling & path filtering -
sampleRateandignorePathsto control overhead in busy environments - Module-per-collector pattern - each optional package is imported in the feature module it instruments, not in the root module
- GraphQL support - profiles queries and mutations with a GQL badge, operation type/name, and syntax-highlighted query via
@eleven-labs/nest-profiler-graphql; compatible with Apollo, Mercurius, and graphql-yoga - CLI command profiling - profiles
nest-commandercommands with a CLI badge in a dedicated Command panel via@eleven-labs/nest-profiler-commander; with file storage the command profiles show up next to HTTP requests at/_profiler
Versioning and stability
Every package follows Semantic Versioning. The public API is what each package exports from its entry point (plus documented subpaths such as @eleven-labs/nest-profiler/sqlite) — breaking changes to it only ship in a major version. Packages are versioned and published together with Changesets.
Two things that are not obvious follow from that:
- The template contract is public. A custom collector renders its panel from an EJS template, so the design tokens, utility classes and EJS helpers in the Template reference are part of the API and stay stable within a major. The rendered markup of the built-in panels is not — it changes whenever the UI does.
- Internal plumbing is not exported. The entry point deliberately exposes only what a host application or a collector package needs. Helpers the profiler uses on itself — the list-page pagination, the in-memory query engine, option resolvers — are kept out of it precisely so they can be reworked in a minor release.
Development only
The profiler is designed for development environments. Disable it in production to avoid exposing
internal request data — gate it with ConditionalModule.registerWhen. See Getting
started.