@eleven-labs/nest-profiler
v1.0.0-alpha.3
Published
NestJS web profiler module inspired by Symfony's Web Profiler
Maintainers
Readme
@eleven-labs/nest-profiler
@eleven-labs/nest-profiler provides execution profiling for NestJS applications. Each profiled execution receives a unique token, and the collected data (request, response, performance, logs, exceptions, custom collectors) can be inspected at /_profiler/{token}.

Installation
pnpm add @eleven-labs/nest-profiler nestjs-clsnestjs-cls is a required peer dependency used for per-execution context propagation.
Quick start
import { Module } from '@nestjs/common';
import { ProfilerModule } from '@eleven-labs/nest-profiler';
@Module({
imports: [
ProfilerModule.forRoot({
isGlobal: true,
// The host app owns the decision — packages never read process.env.
enabled: process.env.NODE_ENV !== 'production',
maxProfiles: 100,
}),
],
})
export class AppModule {}Start the application, make a few requests, and open http://localhost:3000/_profiler. Every non-profiler response also carries an X-Debug-Token-Link header pointing straight to its profile.
Documentation
Each capability has its own focused guide:
| Guide | What it covers |
| -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| Configuration | forRoot / forRootAsync, the full options reference, securing the UI with a Bearer token |
| Log capture | Wrapping any logger so every entry lands in the profile, supported argument conventions |
| Browsing profiles | UI endpoints, debug headers, list filters (built-in and custom), exporting a profile |
| Timeline & custom collectors | startSpan() timing, writing a collector with @ProfilerCollector(), custom EJS panels |
| Custom protocol adapters | Profiling gRPC, Kafka, WebSockets… via IContextAdapter |
| Storage backends | In-memory (default), file system, custom IProfilerStorageAdapter |
| Performance impact & testing | Deferred persistence, why it is free, flush() in automated tests |
The Getting started guide covers the full setup including the optional collector packages (TypeORM, MikroORM, Mongoose, Axios, cache, auth, config, validator, GraphQL, commander), and the Profiler UI page gives a visual tour of every panel.
Public API
import {
ProfilerModule,
ProfilerService,
ProfilerStorageService,
ProfilerViewsSetup,
CollectorRegistry,
ProfilerCollector,
TimelineCollector,
PROFILER_STORAGE_ADAPTER,
MemoryStorageAdapter,
FileStorageAdapter,
createProfilerLogger,
parseLogArgs,
DEFAULT_LOG_METHODS,
} from '@eleven-labs/nest-profiler';
import type {
ProfilerModuleOptions,
ProfilerModuleAsyncOptions,
IProfilerCollector,
IProfilerStorageAdapter,
StorageFindOptions,
CollectorPanelInfo,
Profile,
LogEntry,
ExceptionEntry,
TimelineSpan,
EventEntry,
SecurityContext,
LogMethodMap,
LogArgsParser,
ParsedLogCall,
ProfilerLoggerOptions,
} from '@eleven-labs/nest-profiler';The full generated reference lives at API reference — nest-profiler.
Part of the nest-profiler toolkit · Powered & maintained by Eleven Labs
