NestJS Profiler

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.

Packages

PackagePanelWhat it captures
@eleven-labs/nest-profilerCore + TimelineRequest, response, logs, exceptions, performance spans
@eleven-labs/nest-profiler-typeormDatabaseSQL queries with type, duration, slow-query highlighting
@eleven-labs/nest-profiler-mikro-ormDatabaseSQL queries with type, duration, slow-query highlighting (MikroORM)
@eleven-labs/nest-profiler-mongooseMongoDBMongoose queries & aggregations: collection, operation, duration, result count
@eleven-labs/nest-profiler-httpHTTP ClientOutgoing requests via HttpService: method, URL, status, duration
@eleven-labs/nest-profiler-cacheCacheGET_HIT / GET_MISS / SET / DEL with hit-ratio badge
@eleven-labs/nest-profiler-commanderCommandnest-commander CLI runs: name, arguments, options, exit code
@eleven-labs/nest-profiler-authSecurityrequest.user, JWT claims, roles - sensitive fields masked
@eleven-labs/nest-profiler-configConfigConfigService snapshot with secret masking
@eleven-labs/nest-profiler-validatorValidatorDTO validation results - property violations with constraint names
@eleven-labs/nest-profiler-graphqlGraphQLGraphQL queries/mutations: operation type, name, query, variables
@eleven-labs/nest-profiler-rabbitmqRabbitMQConsumed @RabbitSubscribe messages: exchange, routing key, handler, payload

Key features

  • Floating toolbar - injected into HTML responses with per-collector badges (query count, hit ratio, violation count, …)
  • Extensible collectors - implement IProfilerCollector to 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 - sampleRate and ignorePaths to 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-commander commands 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. The rendered UI, EJS templates and internal services are implementation details and can change in a minor release. Packages are versioned and published together with Changesets.

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.

Powered & maintained by

On this page