nest-profiler
Module options, profile structure, service, collector interface and storage.
Module options
ProfilerModuleOptions
Options passed to ProfilerModule.forRoot().
Prop
Type
ProfilerModuleAsyncOptions
Options passed to ProfilerModule.forRootAsync().
Prop
Type
ProfilerSecurityOptions
Pluggable access control for the profiler UI/API, passed as the security option. Provide an authorize predicate and/or NestJS guards (all must pass); omit it to leave the profiler open. See Securing the UI.
Prop
Type
ProfilerAuthContext
The context passed to a ProfilerAuthorize predicate. ProfilerAuthorize is (context: ProfilerAuthContext) => boolean | Promise<boolean> — return false to deny (the guard throws 401).
Prop
Type
Error classification
What counts as a failure, per entrypoint kind and per collector. See What counts as an error.
ProfilerErrorOptions
The error option of ProfilerModule.forRoot() (the http kind), and of every package contributing a kind — GraphQLCollectorModule, RabbitMqCollectorModule.
Prop
Type
EntryErrorOptions
The error option of a collector judging its own entries, such as HttpCollectorModule.forRoot().
Prop
Type
ProfileErrorInfo
The view of a profile handed to a classify predicate.
Prop
Type
Profile structure
Profile
Full data structure for a collected profile. The entrypoint field records what
triggered it (an HTTP request, a CLI command, a consumed message…).
Prop
Type
ProfileEntrypoint
The discriminated descriptor of a profile's entrypoint. type identifies the kind
('http', 'command', …) and data holds the kind-specific payload,
owned by the package that registered the type.
Prop
Type
HttpRequestData
Payload of the built-in http entrypoint - an HTTP request (REST or GraphQL).
Prop
Type
ResponseData
Prop
Type
PerformanceData
Prop
Type
RouteInfo
Prop
Type
SecurityContext
Populated by the Auth collector when request.user is present.
Prop
Type
ExceptionEntry
Prop
Type
TimelineSpan
Entry written by ProfilerService.startSpan().
Prop
Type
LogEntry
Prop
Type
Entrypoint types
ProfilerEntrypointType
Everything the profiler needs to support an entrypoint kind, registered in one call
via ProfilerCoreService.registerEntrypointType(): the list-page table, the detail
tab(s), the kind-scoped list filters and the breadcrumb summary.
Prop
Type
ProfilerDetailTab
A primary detail-page tab contributed by an entrypoint type. Its body is rendered
from templatePath (an absolute path to an EJS partial that receives { profile }
plus the shared template helpers).
Prop
Type
EntrypointSummary
The compact summary an entrypoint type renders in the detail-page breadcrumb.
Prop
Type
Logging
ProfilerLoggerOptions
Options accepted by createProfilerLogger(). The default parseArgs implementation, exported as parseLogArgs, understands the NestJS (log(message, context), error(message, stack, context)), pino / nestjs-pino (info(mergingObject, message)) and message-first (log(message, payloadObject)) conventions; pass a custom parseArgs for loggers with an exotic argument convention.
Prop
Type
ParsedLogCall
Return value of a LogArgsParser: what the profiler stores for one log call.
Prop
Type
Service
ProfilerService
Injectable facade. Inject it in any provider or controller to instrument your application.
Prop
Type
Collectors
IProfilerCollector
Interface to implement when building a custom collector.
Prop
Type
CollectorPanelInfo
Panel metadata returned by CollectorRegistry.buildPanels(), passed to EJS templates and the toolbar.
Prop
Type
Storage
IProfilerStorageAdapter
Interface for plugging in a custom storage backend.
Prop
Type
StorageFindOptions
Filter options accepted by IProfilerStorageAdapter.findAll().
Prop
Type
FileStorageAdapterOptions
Options for the built-in file-system storage adapter.
Prop
Type
Copy helpers
Pure functions backing the profiler UI's "copy" buttons, exported for reuse.
buildCurlCommand
Builds a runnable, multi-line curl command from captured HTTP request data. Relative URLs are made absolute using the host (and x-forwarded-proto) headers.
Prop
Type
interpolateSql
interpolateSql(sql, parameters) inlines bound parameters into a SQL string, returning a runnable query. Supports both $N (Postgres/TypeORM) and ? (MySQL/MikroORM) placeholders.
Client assets
ClientAssetRegistry
Registry of client-side script bundles the profiler serves same-origin and injects into the page <head>. A package shipping browser behaviour calls register() at startup. See Extending the UI with JavaScript.
Prop
Type
Public exports
import {
ProfilerModule,
ProfilerService,
ProfilerStorageService,
ProfilerViewsSetup,
CollectorRegistry,
ProfilerCollector,
TimelineCollector,
PROFILER_STORAGE_ADAPTER,
MemoryStorageAdapter,
FileStorageAdapter,
createProfilerLogger,
parseLogArgs,
DEFAULT_LOG_METHODS,
buildCurlCommand,
interpolateSql,
ClientAssetRegistry,
CORE_CLIENT_SCRIPT,
} from '@eleven-labs/nest-profiler';
import type {
ProfilerModuleOptions,
ProfilerModuleAsyncOptions,
IProfilerCollector,
IProfilerStorageAdapter,
StorageFindOptions,
FileStorageAdapterOptions,
MemoryStorageAdapterOptions,
CollectorPanelInfo,
Profile,
ProfileEntrypoint,
HttpRequestData,
ResponseData,
PerformanceData,
RouteInfo,
LogEntry,
ExceptionEntry,
LogLevel,
LogMethodMap,
LogArgsParser,
ParsedLogCall,
ProfilerLoggerOptions,
TimelineSpan,
SecurityContext,
CurlInput,
ClientAssetRegistration,
} from '@eleven-labs/nest-profiler';