Interface: NestLensConfig
Defined in: nestlens.config.ts:619
Properties
alerting?
optionalalerting:AlertingConfig
Defined in: nestlens.config.ts:707
Proactive alerting — POST collected entries (exceptions by default) to Slack/Discord/generic webhooks. Disabled by default.
authorization?
optionalauthorization:AuthorizationConfig
Defined in: nestlens.config.ts:679
enabled?
optionalenabled:boolean
Defined in: nestlens.config.ts:621
filter()?
optionalfilter: (entry) =>boolean|Promise<boolean>
Defined in: nestlens.config.ts:715
Filter function to determine if an entry should be collected. Return true to collect the entry, false to skip it. Errors are logged but don't block collection (fail-open).
Parameters
entry
Returns
boolean | Promise<boolean>
filterBatch()?
optionalfilterBatch: (entries) =>Entry[] |Promise<Entry[]>
Defined in: nestlens.config.ts:722
Batch filter function to process multiple entries at once. Return the entries that should be collected. Errors are logged but don't block collection (fail-open).
Parameters
entries
Entry[]
Returns
path?
optionalpath:string
Defined in: nestlens.config.ts:622
preset?
optionalpreset:"failures-only"
Defined in: nestlens.config.ts:646
A configuration for a job people keep writing out themselves.
'failures-only' is the production stance: record nothing ordinary, keep
the failures whole, and stop paying for payload capture nothing will keep.
It sets sampling.rate: 0 with the failing types in sampling.always, a
filter that narrows those types to their failures, and turns off GraphQL
response capture and resolver tracing.
Everything the application writes wins over it, except filter, which
composes: under a preset, a filter of your own means "the failures, and
this too".
NestLensModule.forRoot({
preset: 'failures-only',
server: { host: '0.0.0.0', port: 3001 },
storage: { driver: 'redis', redis: { url: process.env.REDIS_URL, db: 1 } },
alerting: { webhooks: [{ url: process.env.ALERT_WEBHOOK, type: 'slack' }] },
})
pruning?
optionalpruning:PruningConfig
Defined in: nestlens.config.ts:685
rateLimit?
optionalrateLimit:false|RateLimitConfig
Defined in: nestlens.config.ts:694
Rate limiting configuration for API endpoints.
Set to false to disable rate limiting (default).
Set to an object to enable: { windowMs: 60000, maxRequests: 100 }.
Default: disabled (NestLens is a development/debugging tool)
sampling?
optionalsampling:SamplingConfig
Defined in: nestlens.config.ts:667
Record a fraction of traffic instead of all of it.
Absent by default, which records everything. See SamplingConfig.
security?
optionalsecurity:SecurityConfig
Defined in: nestlens.config.ts:700
Security configuration for data masking and input validation.
server?
optionalserver:DashboardServerConfig
Defined in: nestlens.config.ts:676
Serve the dashboard on a listener of its own, bound to a chosen address, instead of mounting it on the application's server.
Absent by default, which is the mounted behaviour every installation has today. See DashboardServerConfig.
storage?
optionalstorage:StorageConfig
Defined in: nestlens.config.ts:682
trustProxy?
optionaltrustProxy:boolean
Defined in: nestlens.config.ts:660
Trust the X-Forwarded-Prefix header when building the dashboard's asset
and API URLs. Enable this only when NestLens sits behind a reverse proxy
that strips a path segment (nginx proxy_pass with a trailing slash, a
Kubernetes ingress rewrite) and that proxy sets the header itself.
Off by default: the header is attacker-controlled, and honouring it unconditionally would let a request repoint the dashboard's URLs — which a shared cache in front of the application could then serve to other users.
Default
false
watchers?
optionalwatchers:object
Defined in: nestlens.config.ts:725
batch?
optionalbatch:boolean|BatchWatcherConfig
cache?
optionalcache:boolean|CacheWatcherConfig
command?
optionalcommand:boolean|CommandWatcherConfig
dump?
optionaldump:boolean|DumpWatcherConfig
event?
optionalevent:boolean|EventWatcherConfig
exception?
optionalexception:boolean|ExceptionWatcherConfig
gate?
optionalgate:boolean|GateWatcherConfig
graphql?
optionalgraphql:boolean|GraphQLWatcherConfig
httpClient?
optionalhttpClient:boolean|HttpClientWatcherConfig
job?
optionaljob:boolean|JobWatcherConfig
log?
optionallog:boolean|LogWatcherConfig
mail?
optionalmail:boolean|MailWatcherConfig
model?
optionalmodel:boolean|ModelWatcherConfig
notification?
optionalnotification:boolean|NotificationWatcherConfig
query?
optionalquery:boolean|QueryWatcherConfig
redis?
optionalredis:boolean|RedisWatcherConfig
request?
optionalrequest:boolean|RequestWatcherConfig
schedule?
optionalschedule:boolean|ScheduleWatcherConfig
view?
optionalview:boolean|ViewWatcherConfig